diff --git a/Cartesian_kernel/include/CGAL/Cartesian/Vector_2.h b/Cartesian_kernel/include/CGAL/Cartesian/Vector_2.h index ab8db68c2bd..a58531e02c3 100644 --- a/Cartesian_kernel/include/CGAL/Cartesian/Vector_2.h +++ b/Cartesian_kernel/include/CGAL/Cartesian/Vector_2.h @@ -48,7 +48,9 @@ class VectorC2 public: - typedef R_ R; + typedef typename Rep::const_iterator Cartesian_const_iterator; + + typedef R_ R; VectorC2() {} @@ -84,6 +86,16 @@ public: return constant(); } + Cartesian_const_iterator cartesian_begin() const + { + return get(base).begin(); + } + + Cartesian_const_iterator cartesian_end() const + { + return get(base).end(); + } + }; template < class R > diff --git a/Cartesian_kernel/include/CGAL/Cartesian/Vector_3.h b/Cartesian_kernel/include/CGAL/Cartesian/Vector_3.h index 1b5cc2ba48e..59aabbb11bf 100644 --- a/Cartesian_kernel/include/CGAL/Cartesian/Vector_3.h +++ b/Cartesian_kernel/include/CGAL/Cartesian/Vector_3.h @@ -47,7 +47,9 @@ class VectorC3 public: - typedef R_ R; + typedef typename Rep::const_iterator Cartesian_const_iterator; + + typedef R_ R; VectorC3() {} @@ -103,6 +105,16 @@ public: return constant(); } + Cartesian_const_iterator cartesian_begin() const + { + return get(base).begin(); + } + + Cartesian_const_iterator cartesian_end() const + { + return get(base).end(); + } + const FT & cartesian(int i) const; const FT & operator[](int i) const; const FT & homogeneous(int i) const; diff --git a/Homogeneous_kernel/include/CGAL/Homogeneous/VectorH2.h b/Homogeneous_kernel/include/CGAL/Homogeneous/VectorH2.h index f27dab275bc..c2856d125eb 100644 --- a/Homogeneous_kernel/include/CGAL/Homogeneous/VectorH2.h +++ b/Homogeneous_kernel/include/CGAL/Homogeneous/VectorH2.h @@ -27,6 +27,7 @@ #include #include +#include CGAL_BEGIN_NAMESPACE @@ -54,6 +55,8 @@ public: typedef const FT Cartesian_coordinate_type; typedef const RT& Homogeneous_coordinate_type; + typedef Cartesian_const_iterator_d Cartesian_const_iterator; + typedef R_ R; VectorH2() {} @@ -99,6 +102,17 @@ public: const RT & homogeneous(int i) const; FT operator[](int i) const; + Cartesian_const_iterator cartesian_begin() const + { + return make_cartesian_const_iterator_begin(get(base).begin(), + boost::prior(get(base).end())); + } + + Cartesian_const_iterator cartesian_end() const + { + return make_cartesian_const_iterator_end(boost::prior(get(base).end())); + } + int dimension() const; Direction_2 direction() const; Vector_2 perpendicular(const Orientation& o ) const; diff --git a/Homogeneous_kernel/include/CGAL/Homogeneous/VectorH3.h b/Homogeneous_kernel/include/CGAL/Homogeneous/VectorH3.h index c04c09479cd..0a44ce5e0e9 100644 --- a/Homogeneous_kernel/include/CGAL/Homogeneous/VectorH3.h +++ b/Homogeneous_kernel/include/CGAL/Homogeneous/VectorH3.h @@ -26,6 +26,7 @@ #include #include +#include CGAL_BEGIN_NAMESPACE @@ -50,6 +51,8 @@ class VectorH3 public: + typedef Cartesian_const_iterator_d Cartesian_const_iterator; + typedef R_ R; VectorH3() {} @@ -104,6 +107,17 @@ public: FT cartesian(int i) const; FT operator[](int i) const; + Cartesian_const_iterator cartesian_begin() const + { + return make_cartesian_const_iterator_begin(get(base).begin(), + boost::prior(get(base).end())); + } + + Cartesian_const_iterator cartesian_end() const + { + return make_cartesian_const_iterator_end(boost::prior(get(base).end())); + } + int dimension() const { return 3; }; Direction_3 direction() const; diff --git a/Kernel_23/doc_tex/Kernel_23_ref/Kernel_ConstructCartesianConstIterator_2.tex b/Kernel_23/doc_tex/Kernel_23_ref/Kernel_ConstructCartesianConstIterator_2.tex index 8b742f2292d..96a340aad17 100644 --- a/Kernel_23/doc_tex/Kernel_23_ref/Kernel_ConstructCartesianConstIterator_2.tex +++ b/Kernel_23/doc_tex/Kernel_23_ref/Kernel_ConstructCartesianConstIterator_2.tex @@ -11,6 +11,12 @@ A model for this must provide: &p, int);} {returns the past the end iterator of the \ccHtmlNoLinksFrom{Cartesian} coordinates of \ccc{p}.} +\ccMemberFunction{Kernel::Cartesian_const_iterator_2 operator()(const Kernel::Vector_2 + &v);} {returns an iterator on the 0'th \ccHtmlNoLinksFrom{Cartesian} coordinate of \ccc{v}.} + +\ccMemberFunction{Kernel::Cartesian_const_iterator_2 operator()(const Kernel::Vector_2 + &v, int);} {returns the past the end iterator of the \ccHtmlNoLinksFrom{Cartesian} coordinates of \ccc{v}.} + \ccRefines diff --git a/Kernel_23/doc_tex/Kernel_23_ref/Kernel_ConstructCartesianConstIterator_3.tex b/Kernel_23/doc_tex/Kernel_23_ref/Kernel_ConstructCartesianConstIterator_3.tex index adf5e4f68aa..02aa76042d6 100644 --- a/Kernel_23/doc_tex/Kernel_23_ref/Kernel_ConstructCartesianConstIterator_3.tex +++ b/Kernel_23/doc_tex/Kernel_23_ref/Kernel_ConstructCartesianConstIterator_3.tex @@ -11,6 +11,12 @@ A model for this must provide: &p, int);} {returns the past the end iterator of the \ccHtmlNoLinksFrom{Cartesian} coordinates of \ccc{p}.} +\ccMemberFunction{Kernel::Cartesian_const_iterator_3 operator()(const Kernel::Vector_3 + &v);} {returns an iterator on the 0'th \ccHtmlNoLinksFrom{Cartesian} coordinate of \ccc{v}.} + +\ccMemberFunction{Kernel::Cartesian_const_iterator_3 operator()(const Kernel::Vector_3 + &v, int);} {returns the past the end iterator of the \ccHtmlNoLinksFrom{Cartesian} coordinates of \ccc{v}.} + \ccRefines diff --git a/Kernel_23/doc_tex/Kernel_23_ref/Vector_2.tex b/Kernel_23/doc_tex/Kernel_23_ref/Vector_2.tex index c3b551ed33f..4ef98ae61ed 100644 --- a/Kernel_23/doc_tex/Kernel_23_ref/Vector_2.tex +++ b/Kernel_23/doc_tex/Kernel_23_ref/Vector_2.tex @@ -11,6 +11,12 @@ from $p_1$ to $p_2$. will explicitly state where you can pass this constant as an argument instead of a vector initialized with zeros. +\ccTypes +\ccThree{Cartesian_const_iterator}{Facet }{} +\ccThreeToTwo + +\ccNestedType{Cartesian_const_iterator}{An iterator for enumerating the + \ccHtmlNoLinksFrom{Cartesian} coordinates of a vector.} \ccCreation \ccCreationVariable{v} @@ -103,6 +109,14 @@ with higher dimensional vectors. Again they come in a {returns \ccStyle{cartesian(i)}. \ccPrecond $0\leq i \leq 1$.} +\ccMethod{Cartesian_const_iterator cartesian_begin() const;} + {returns an iterator to the \ccHtmlNoLinksFrom{Cartesian} coordinates + of \ccVar, starting with the 0th coordinate.} + +\ccMethod{Cartesian_const_iterator cartesian_end() const;} + {returns an off the end iterator to the \ccHtmlNoLinksFrom{Cartesian} + coordinates of \ccVar.} + \ccMethod{int dimension() const;} {returns the dimension (the constant 2).} diff --git a/Kernel_23/doc_tex/Kernel_23_ref/Vector_3.tex b/Kernel_23/doc_tex/Kernel_23_ref/Vector_3.tex index c0847e97678..6a81392cc9c 100644 --- a/Kernel_23/doc_tex/Kernel_23_ref/Vector_3.tex +++ b/Kernel_23/doc_tex/Kernel_23_ref/Vector_3.tex @@ -11,6 +11,12 @@ from $p_1$ to $p_2$. will explicitly state where you can pass this constant as an argument instead of a vector initialized with zeros. +\ccTypes +\ccThree{Cartesian_const_iterator}{Facet }{} +\ccThreeToTwo + +\ccNestedType{Cartesian_const_iterator}{An iterator for enumerating the + \ccHtmlNoLinksFrom{Cartesian} coordinates of a vector.} \ccCreation \ccCreationVariable{v} @@ -108,6 +114,14 @@ with higher dimensional vectors. Again they come in a {returns \ccStyle{cartesian(i)}. \ccPrecond $0\leq i \leq 2$.} +\ccMethod{Cartesian_const_iterator cartesian_begin() const;} + {returns an iterator to the \ccHtmlNoLinksFrom{Cartesian} coordinates + of \ccVar, starting with the 0th coordinate.} + +\ccMethod{Cartesian_const_iterator cartesian_end() const;} + {returns an off the end iterator to the \ccHtmlNoLinksFrom{Cartesian} + coordinates of \ccVar.} + \ccMethod{int dimension() const;} {returns the dimension (the constant 3).} diff --git a/Kernel_23/include/CGAL/Kernel/Cartesian_coordinate_iterator_2.h b/Kernel_23/include/CGAL/Kernel/Cartesian_coordinate_iterator_2.h index 55eb3f61511..9e2bc1b53c5 100644 --- a/Kernel_23/include/CGAL/Kernel/Cartesian_coordinate_iterator_2.h +++ b/Kernel_23/include/CGAL/Kernel/Cartesian_coordinate_iterator_2.h @@ -17,7 +17,7 @@ // // $URL$ // $Id$ -// +// // // Author(s) : Andreas Fabri @@ -26,24 +26,29 @@ #include #include +#include CGAL_BEGIN_NAMESPACE +// This class should go away. +// It is now only used by the Filtered_kernel. +// It allows to iterate over the coordinates of both a Point_2 and a Vector_2, +// using a boost::variant, as the iterator types are the same at the kernel level. template -class Cartesian_coordinate_iterator_2 +class Cartesian_coordinate_iterator_2 { protected: typedef typename K::Point_2 P; - const P* point; + typedef typename K::Vector_2 V; + boost::variant var; int index; typedef Cartesian_coordinate_iterator_2 Self; -public: +public: typedef typename K::FT FT; - typedef P Point; typedef std::random_access_iterator_tag iterator_category; typedef FT value_type; @@ -51,33 +56,43 @@ public: typedef const value_type& reference; typedef const value_type* pointer; - Cartesian_coordinate_iterator_2(const Point *const p = NULL, - int _index = 0) - : point(p), index(_index) - {} + Cartesian_coordinate_iterator_2() + : var((const P*) NULL), index(0) {} + + Cartesian_coordinate_iterator_2(const P * const p, int _index = 0) + : var(p), index(_index) {} + + Cartesian_coordinate_iterator_2(const V * const v, int _index = 0) + : var(v), index(_index) {} - const FT + const FT operator*() const { - return point->cartesian(index); + if (const P* const* p = boost::get(&var)) + return (*p)->cartesian(index); + if (const V* const* v = boost::get(&var)) + return (*v)->cartesian(index); + // std::cerr << "type of var = " << var.type().name() << std::endl; + CGAL_error(); + std::abort(); // to kill warning } - + Self& operator++() { - index++; + index++; return *this; } - Self& + Self& operator--() { - index--; + index--; return *this; } - Self - operator++(int) { + Self + operator++(int) { Self tmp(*this); - ++(*this); - return tmp; + ++(*this); + return tmp; } Self @@ -86,55 +101,55 @@ public: --(*this); return tmp; } - - Self& - operator+=(difference_type i) { + + Self& + operator+=(difference_type i) { index+=i; - return *this; + return *this; } - Self& - operator-=(difference_type i) { - index -= i; - return *this; + Self& + operator-=(difference_type i) { + index -= i; + return *this; } - Self + Self operator+(difference_type i) const { - Self tmp=*this; - return tmp += i; + Self tmp=*this; + return tmp += i; } Self operator-(difference_type i) const { - Self tmp=*this; - return tmp -= i; + Self tmp=*this; + return tmp -= i; } - difference_type + difference_type operator-(const Self& x) const { - CGAL_kernel_assertion(point == x.point); - return index - x.index; + CGAL_kernel_assertion(var == x.var); + return index - x.index; } - reference operator[](difference_type i) const { - return *(*this + i); + reference operator[](difference_type i) const { + return *(*this + i); } bool operator==(const Self& x) const { - return (point == x.point)&& (index == x.index) ; - } - - bool operator!=(const Self& x) const { - return ! (*this==x); + return (var == x.var) && (index == x.index); } - bool operator<(const Self& x) const - { - return (x - *this) > 0; } + bool operator!=(const Self& x) const { + return ! (*this==x); + } + + bool operator<(const Self& x) const + { + return (x - *this) > 0; + } }; - - CGAL_END_NAMESPACE + #endif // CGAL_CARTESIAN_COORDINATE_ITERATOR_2_H diff --git a/Kernel_23/include/CGAL/Kernel/Cartesian_coordinate_iterator_3.h b/Kernel_23/include/CGAL/Kernel/Cartesian_coordinate_iterator_3.h index 0a9b513d38b..9afa9c5a084 100644 --- a/Kernel_23/include/CGAL/Kernel/Cartesian_coordinate_iterator_3.h +++ b/Kernel_23/include/CGAL/Kernel/Cartesian_coordinate_iterator_3.h @@ -17,7 +17,7 @@ // // $URL$ // $Id$ -// +// // // Author(s) : Andreas Fabri @@ -26,23 +26,27 @@ #include #include +#include CGAL_BEGIN_NAMESPACE +// This class should go away. +// It is now only used by the Filtered_kernel. +// It allows to iterate over the coordinates of both a Point_3 and a Vector_3, +// using a boost::variant, as the iterator types are the same at the kernel level. template -class Cartesian_coordinate_iterator_3 +class Cartesian_coordinate_iterator_3 { - typedef typename K::Point_3 P; - const P* point; + typedef typename K::Vector_3 V; + boost::variant var; int index; typedef Cartesian_coordinate_iterator_3 Self; -public: +public: typedef typename K::FT FT; - typedef P Point; typedef std::random_access_iterator_tag iterator_category; typedef FT value_type; @@ -50,33 +54,42 @@ public: typedef const value_type& reference; typedef const value_type* pointer; - Cartesian_coordinate_iterator_3(const Point *const p = NULL, - int _index = 0) - : point(p), index(_index) - {} + Cartesian_coordinate_iterator_3() + : var((const P*) NULL), index(0) {} + Cartesian_coordinate_iterator_3(const P *const p, int _index = 0) + : var(p), index(_index) {} - const FT + Cartesian_coordinate_iterator_3(const V *const v, int _index = 0) + : var(v), index(_index) {} + + const FT operator*() const { - return point->cartesian(index); + if (const P* const* p = boost::get(&var)) + return (*p)->cartesian(index); + if (const V* const* v = boost::get(&var)) + return (*v)->cartesian(index); + // std::cerr << "type of var = " << var.type().name() << std::endl; + CGAL_error(); + std::abort(); // to kill warning } - + Self& operator++() { - index++; + index++; return *this; } - Self& + Self& operator--() { - index--; + index--; return *this; } - Self - operator++(int) { + Self + operator++(int) { Self tmp(*this); - ++(*this); - return tmp; + ++(*this); + return tmp; } Self @@ -85,55 +98,55 @@ public: --(*this); return tmp; } - - Self& - operator+=(difference_type i) { + + Self& + operator+=(difference_type i) { index+=i; - return *this; + return *this; } - Self& - operator-=(difference_type i) { - index -= i; - return *this; + Self& + operator-=(difference_type i) { + index -= i; + return *this; } - Self + Self operator+(difference_type i) const { - Self tmp=*this; - return tmp += i; + Self tmp=*this; + return tmp += i; } Self operator-(difference_type i) const { - Self tmp=*this; - return tmp -= i; + Self tmp=*this; + return tmp -= i; } - difference_type + difference_type operator-(const Self& x) const { - CGAL_kernel_assertion(point == x.point); - return index - x.index; + CGAL_kernel_assertion(var == x.var); + return index - x.index; } - reference operator[](difference_type i) const { - return *(*this + i); + reference operator[](difference_type i) const { + return *(*this + i); } bool operator==(const Self& x) const { - return (point == x.point)&& (index == x.index) ; - } - - bool operator!=(const Self& x) const { - return ! (*this==x); + return (var == x.var) && (index == x.index) ; } - bool operator<(const Self& x) const - { - return (x - *this) > 0; } + bool operator!=(const Self& x) const { + return ! (*this==x); + } + + bool operator<(const Self& x) const + { + return (x - *this) > 0; + } }; - - CGAL_END_NAMESPACE + #endif // CGAL_CARTESIAN_COORDINATE_ITERATOR_3_H diff --git a/Kernel_23/include/CGAL/Kernel/function_objects.h b/Kernel_23/include/CGAL/Kernel/function_objects.h index 1df0d412ce5..86bed02b938 100644 --- a/Kernel_23/include/CGAL/Kernel/function_objects.h +++ b/Kernel_23/include/CGAL/Kernel/function_objects.h @@ -1741,6 +1741,7 @@ namespace CommonKernelFunctors { class Construct_cartesian_const_iterator_2 { typedef typename K::Point_2 Point_2; + typedef typename K::Vector_2 Vector_2; typedef typename K::Cartesian_const_iterator_2 Cartesian_const_iterator_2; @@ -1750,21 +1751,34 @@ namespace CommonKernelFunctors { Cartesian_const_iterator_2 operator()( const Point_2& p) const - { - return p.rep().cartesian_begin(); - } + { + return p.rep().cartesian_begin(); + } Cartesian_const_iterator_2 operator()( const Point_2& p, int) const { return p.rep().cartesian_end(); } + + Cartesian_const_iterator_2 + operator()( const Vector_2& v) const + { + return v.rep().cartesian_begin(); + } + + Cartesian_const_iterator_2 + operator()( const Vector_2& v, int) const + { + return v.rep().cartesian_end(); + } }; template class Construct_cartesian_const_iterator_3 { typedef typename K::Point_3 Point_3; + typedef typename K::Vector_3 Vector_3; typedef typename K::Cartesian_const_iterator_3 Cartesian_const_iterator_3; @@ -1774,15 +1788,27 @@ namespace CommonKernelFunctors { Cartesian_const_iterator_3 operator()( const Point_3& p) const - { - return p.rep().cartesian_begin(); - } + { + return p.rep().cartesian_begin(); + } Cartesian_const_iterator_3 operator()( const Point_3& p, int) const { return p.rep().cartesian_end(); } + + Cartesian_const_iterator_3 + operator()( const Vector_3& v) const + { + return v.rep().cartesian_begin(); + } + + Cartesian_const_iterator_3 + operator()( const Vector_3& v, int) const + { + return v.rep().cartesian_end(); + } }; template diff --git a/Kernel_23/include/CGAL/Vector_2.h b/Kernel_23/include/CGAL/Vector_2.h index 23fe321c788..a2b3728b8c7 100644 --- a/Kernel_23/include/CGAL/Vector_2.h +++ b/Kernel_23/include/CGAL/Vector_2.h @@ -52,6 +52,7 @@ class Vector_2 : public R_::Kernel_base::Vector_2 public: typedef RVector_2 Rep; + typedef typename R_::Cartesian_const_iterator_2 Cartesian_const_iterator; const Rep& rep() const { @@ -123,6 +124,16 @@ public: return cartesian(i); } + Cartesian_const_iterator cartesian_begin() const + { + return typename R::Construct_cartesian_const_iterator_2()(*this); + } + + Cartesian_const_iterator cartesian_end() const + { + return typename R::Construct_cartesian_const_iterator_2()(*this,2); + } + typename Qualified_result_of::type hx() const { diff --git a/Kernel_23/include/CGAL/Vector_3.h b/Kernel_23/include/CGAL/Vector_3.h index fe18077b631..8ce54737b91 100644 --- a/Kernel_23/include/CGAL/Vector_3.h +++ b/Kernel_23/include/CGAL/Vector_3.h @@ -50,7 +50,8 @@ class Vector_3 : public R_::Kernel_base::Vector_3 public: - typedef typename R_::Kernel_base::Vector_3 Rep; + typedef typename R_::Cartesian_const_iterator_3 Cartesian_const_iterator; + typedef typename R_::Kernel_base::Vector_3 Rep; const Rep& rep() const { @@ -203,6 +204,16 @@ public: return cartesian(i); } + Cartesian_const_iterator cartesian_begin() const + { + return typename R::Construct_cartesian_const_iterator_3()(*this); + } + + Cartesian_const_iterator cartesian_end() const + { + return typename R::Construct_cartesian_const_iterator_3()(*this,3); + } + typename Qualified_result_of::type squared_length() const { diff --git a/Kernel_23/test/Kernel_23/include/CGAL/_test_cls_vector_2.h b/Kernel_23/test/Kernel_23/include/CGAL/_test_cls_vector_2.h index dd1c0efe9e8..aad38e399cd 100644 --- a/Kernel_23/test/Kernel_23/include/CGAL/_test_cls_vector_2.h +++ b/Kernel_23/test/Kernel_23/include/CGAL/_test_cls_vector_2.h @@ -32,6 +32,8 @@ _test_cls_vector_2(const R& ) typedef typename R::FT FT; typename R::Vector_2 iv; + typedef typename R::Vector_2::Cartesian_const_iterator CCI; + CGAL::Vector_2 v1; CGAL::Vector_2 v2(iv); CGAL::Vector_2 v0(CGAL::NULL_VECTOR); @@ -100,6 +102,63 @@ _test_cls_vector_2(const R& ) assert( v10.direction() == v8.direction() ); assert( v11.direction() == v8.direction() ); + + // now we test the Coordinate iterator + const CGAL::Vector_2 v(1, 2); + + CCI it = v.cartesian_begin(); + + // Default constructor + CCI itt; + + // Copy constructor + CCI itc(it); + + assert(itc == it); + + // Assignment + itt = it; + + // Equality + assert(itt == it); + + assert(itt - it == 0); + + // Increment + itt++; + + // Inequality + assert(itt != it); + + assert(it < itt); + assert(itt - it == 1); + + // dereference + assert(*it == FT(1)); + + it++; + assert(*it == FT(2)); + it++; + + CCI it2 = v.cartesian_end(); + + assert(it == it2); + it--; + it--; + assert(*it == FT(1)); + it += 1; + assert(*it == FT(2)); + it -= 1; + assert(*it == FT(1)); + + it2 = it + 1; + it2--; + assert(it == it2); + it++; + it2 = it - 1; + it2++; + assert(it == it2); + std::cout << "done" << std::endl; return true; } diff --git a/Kernel_23/test/Kernel_23/include/CGAL/_test_cls_vector_3.h b/Kernel_23/test/Kernel_23/include/CGAL/_test_cls_vector_3.h index c416da77cbc..855d0c8a5be 100644 --- a/Kernel_23/test/Kernel_23/include/CGAL/_test_cls_vector_3.h +++ b/Kernel_23/test/Kernel_23/include/CGAL/_test_cls_vector_3.h @@ -32,6 +32,7 @@ _test_cls_vector_3(const R& ) typedef typename R::FT FT; typename R::Vector_3 iv; + typedef typename R::Vector_3::Cartesian_const_iterator CCI; CGAL::Vector_3 v1; CGAL::Vector_3 v2(iv); @@ -91,6 +92,69 @@ _test_cls_vector_3(const R& ) assert( v0.dimension() == 3 ); + + // now we test the Coordinate iterator + const CGAL::Vector_3 v(1, 2, 3); + + CCI it = v.cartesian_begin(); + + // Default constructor + CCI itt; + + // Copy constructor + CCI itc(it); + + assert(itc == it); + + // Assignment + itt = it; + + // Equality + assert(itt == it); + + assert(itt - it == 0); + + // Increment + itt++; + + // Inequality + assert(itt != it); + + assert(it < itt); + assert(itt - it == 1); + + itt++; + assert(itt - it == 2); + + // dereference + assert(*it == FT(1)); + + it++; + assert(*it == FT(2)); + it++; + assert(*it == FT(3)); + + it++; + CCI it2 = v.cartesian_end(); + + assert(it == it2); + it--; + it--; + it--; + assert(*it == FT(1)); + it += 1; + assert(*it == FT(2)); + it -= 1; + assert(*it == FT(1)); + + it2 = it + 1; + it2--; + assert(it == it2); + it++; + it2 = it - 1; + it2++; + assert(it == it2); + std::cout << "done" << std::endl; return true; } diff --git a/Kernel_23/test/Kernel_23/include/CGAL/_test_new_2.h b/Kernel_23/test/Kernel_23/include/CGAL/_test_new_2.h index d7e214950d2..b55cd8fde5c 100644 --- a/Kernel_23/test/Kernel_23/include/CGAL/_test_new_2.h +++ b/Kernel_23/test/Kernel_23/include/CGAL/_test_new_2.h @@ -248,6 +248,8 @@ test_new_2(const R& rep) cccit = construct_cartesian_const_iterator_2(p1); cccit = construct_cartesian_const_iterator_2(p1,0); + cccit = construct_cartesian_const_iterator_2(v6); + cccit = construct_cartesian_const_iterator_2(v6,0); #ifndef CGAL_NO_DEPRECATED_CODE typename R::Construct_supporting_line_2 construct_supporting_line diff --git a/Kernel_23/test/Kernel_23/include/CGAL/_test_new_3.h b/Kernel_23/test/Kernel_23/include/CGAL/_test_new_3.h index d3773119ac9..c1023c6d63f 100644 --- a/Kernel_23/test/Kernel_23/include/CGAL/_test_new_3.h +++ b/Kernel_23/test/Kernel_23/include/CGAL/_test_new_3.h @@ -299,6 +299,8 @@ test_new_3(const R& rep) cccit = construct_cartesian_const_iterator_3(p1); cccit = construct_cartesian_const_iterator_3(p1,0); + cccit = construct_cartesian_const_iterator_3(v5); + cccit = construct_cartesian_const_iterator_3(v5,0); #ifndef CGAL_NO_DEPRECATED_CODE typename R::Construct_supporting_line_3 construct_supporting_line