From 20a6e9ebc997fdf3934b35835ab8a3a5ba6870bf Mon Sep 17 00:00:00 2001 From: Guillaume Damiand Date: Thu, 3 Nov 2016 08:29:11 -0400 Subject: [PATCH] Variadic version of iterator starts with 3 template arguments to avoid several specialization match. --- .../include/CGAL/GMap_dart_iterators.h | 202 +++++++++--------- 1 file changed, 103 insertions(+), 99 deletions(-) diff --git a/Generalized_map/include/CGAL/GMap_dart_iterators.h b/Generalized_map/include/CGAL/GMap_dart_iterators.h index 2b38c398c39..32b7cd9bfb8 100644 --- a/Generalized_map/include/CGAL/GMap_dart_iterators.h +++ b/Generalized_map/include/CGAL/GMap_dart_iterators.h @@ -47,83 +47,83 @@ namespace CGAL { template class GMap_dart_iterator_basic_of_orbit_generic; #else - template + template class GMap_dart_iterator_basic_of_orbit_generic; - template + template struct Get_GMap_dart_iterator_basic_of_orbit; - template + template struct Get_GMap_dart_iterator_basic_of_orbit { - typedef GMap_dart_iterator_basic_of_orbit_generic type; + typedef GMap_dart_iterator_basic_of_orbit_generic type; }; - template + template struct Get_GMap_dart_iterator_basic_of_orbit + A1,A2,A3,A4,A5,A6,A7,A8,-1> { - typedef GMap_dart_iterator_basic_of_orbit_generic type; + typedef GMap_dart_iterator_basic_of_orbit_generic type; }; - template + template struct Get_GMap_dart_iterator_basic_of_orbit + A1,A2,A3,A4,A5,A6,A7,-1,-1> { typedef GMap_dart_iterator_basic_of_orbit_generic type; + A1,A2,A3,A4,A5,A6,A7> type; }; - template + template struct Get_GMap_dart_iterator_basic_of_orbit + A1,A2,A3,A4,A5,A6,-1,-1,-1> { - typedef GMap_dart_iterator_basic_of_orbit_generic type; + typedef GMap_dart_iterator_basic_of_orbit_generic type; }; - template + template struct Get_GMap_dart_iterator_basic_of_orbit + A1,A2,A3,A4,A5,-1,-1,-1,-1> { - typedef GMap_dart_iterator_basic_of_orbit_generic type; + typedef GMap_dart_iterator_basic_of_orbit_generic type; }; - template + template struct Get_GMap_dart_iterator_basic_of_orbit + A1,A2,A3,A4,-1,-1,-1,-1,-1> { - typedef GMap_dart_iterator_basic_of_orbit_generic type; + typedef GMap_dart_iterator_basic_of_orbit_generic type; }; - template + template struct Get_GMap_dart_iterator_basic_of_orbit + A1,A2,A3,-1,-1,-1,-1,-1,-1> { - typedef GMap_dart_iterator_basic_of_orbit_generic type; + typedef GMap_dart_iterator_basic_of_orbit_generic type; }; - template + template struct Get_GMap_dart_iterator_basic_of_orbit + A1,A2,-1,-1,-1,-1,-1,-1,-1> { - typedef GMap_dart_iterator_basic_of_orbit_generic type; + typedef GMap_dart_iterator_basic_of_orbit_generic type; }; - template + template struct Get_GMap_dart_iterator_basic_of_orbit + A1,-1,-1,-1,-1,-1,-1,-1,-1> { - typedef GMap_dart_iterator_basic_of_orbit_generic type; + typedef GMap_dart_iterator_basic_of_orbit_generic type; }; template @@ -502,19 +502,19 @@ namespace CGAL { bool mnext_try_first_alpha; }; //**************************************************************************** - /* Class GMap_dart_iterator_basic_of_orbit: to iterate - * on the darts of the orbit : Ai: to iterate + * on the darts of the orbit : Ai - class GMap_dart_iterator_basic_of_orbit_generic: - public GMap_dart_iterator_basic_of_two_alpha + template + class GMap_dart_iterator_basic_of_orbit_generic: + public GMap_dart_iterator_basic_of_two_alpha { public: - typedef GMap_dart_iterator_basic_of_orbit_generic Self; - typedef GMap_dart_iterator_basic_of_two_alpha Base; + typedef GMap_dart_iterator_basic_of_orbit_generic Self; + typedef GMap_dart_iterator_basic_of_two_alpha Base; typedef typename Base::Dart_handle Dart_handle; typedef typename Base::Map Map; @@ -535,7 +535,8 @@ namespace CGAL { {} }; //**************************************************************************** - // TODO do the class and the specializations + /// TODO The template specialization with 3 alpha + // /* Class CMap_dart_iterator_basic_of_three_alpha: to iterate * on the darts of the orbit : @@ -545,7 +546,8 @@ namespace CGAL { * the destructor, possible problem with the rewind). If you are not sure, * use CMap_dart_iterator_basic_of_two_alpha. */ - template class GMap_dart_iterator_basic_of_three_alpha : public CMap_dart_iterator @@ -574,26 +576,27 @@ namespace CGAL { /// Main constructor. GMap_dart_iterator_basic_of_three_alpha(Map& amap, Dart_handle adart, - size_type /*amark*/): + size_type): Base(amap, adart) {} - }; + }; */ //**************************************************************************** - /* Class GMap_dart_iterator_basic_of_orbit: to iterate onto - * the darts of the orbit , Bi: to iterate onto + * the darts of the orbit , Ai, , which are specific cases. + * not for , , which are specific cases. */ - template - class GMap_dart_iterator_basic_of_orbit_generic: + + /* template + class GMap_dart_iterator_basic_of_orbit_generic: public GMap_extend_iterator, Bk> + , Ak> { public: - typedef GMap_dart_iterator_basic_of_orbit_generic Self; + typedef GMap_dart_iterator_basic_of_orbit_generic Self; typedef GMap_extend_iterator, Bk> Base; + , Ak> Base; typedef typename Base::Dart_handle Dart_handle; typedef typename Base::Map Map; @@ -601,7 +604,7 @@ namespace CGAL { typedef Tag_true Basic_iterator; ///< True iff this iterator is basic - CGAL_static_assertion( Bi - class GMap_dart_iterator_basic_of_orbit_generic: - public CMap_extend_iterator + class GMap_dart_iterator_basic_of_orbit_generic: + public GMap_extend_iterator, + , Ai> { public: - typedef GMap_dart_iterator_basic_of_orbit_generic Self; - typedef CMap_extend_iterator Self; + typedef GMap_extend_iterator, + , Ai> Base; typedef typename Base::Dart_handle Dart_handle; @@ -642,13 +646,13 @@ namespace CGAL { }; //**************************************************************************** /// Non const basic of orbit iterator - template + template class GMap_dart_iterator_basic_of_orbit: - public GMap_dart_iterator_basic_of_orbit_generic + public GMap_dart_iterator_basic_of_orbit_generic { public: - typedef GMap_dart_iterator_basic_of_orbit Self; - typedef GMap_dart_iterator_basic_of_orbit_generic Base; + typedef GMap_dart_iterator_basic_of_orbit Self; + typedef GMap_dart_iterator_basic_of_orbit_generic Base; typedef typename Map::Dart_handle Dart_handle; typedef typename Base::Use_mark Use_mark; ///< True iff this iterator uses mark @@ -668,19 +672,19 @@ namespace CGAL { #else //CGAL_CFG_NO_CPP0X_VARIADIC_TEMPLATES //**************************************************************************** /// Generic nD version. - template + template class GMap_dart_iterator_basic_of_orbit_generic: - public CMap_extend_iterator - ::type, B1> + public GMap_extend_iterator + ::type, A1> { public: typedef typename GMap_dart_iterator_basic_of_orbit_generic - ::type Self; - typedef CMap_extend_iterator - ::type, B1> Base; + ::type Self; + typedef GMap_extend_iterator + ::type, A1> Base; typedef typename Base::Dart_handle Dart_handle; typedef typename Base::Map Map; @@ -697,17 +701,17 @@ namespace CGAL { }; //**************************************************************************** /// Non const basic of orbit iterator - template + template class GMap_dart_iterator_basic_of_orbit: - public Get_GMap_dart_iterator_basic_of_orbit::type + public Get_GMap_dart_iterator_basic_of_orbit::type { public: - typedef GMap_dart_iterator_basic_of_orbit + typedef GMap_dart_iterator_basic_of_orbit Self; - typedef typename Get_GMap_dart_iterator_basic_of_orbit::type + typedef typename Get_GMap_dart_iterator_basic_of_orbit::type Base; typedef typename Map::Dart_handle Dart_handle; @@ -1068,23 +1072,23 @@ namespace CGAL { }; #else //**************************************************************************** - template + template class GMap_dart_iterator_of_orbit_generic: public CMap_non_basic_iterator::type> + ::type> { public: - typedef GMap_dart_iterator_of_orbit_generic Self; + typedef GMap_dart_iterator_of_orbit_generic Self; typedef CMap_non_basic_iterator::type> Base; + ::type> Base; typedef typename Base::Map Map; typedef typename Base::Dart_handle Dart_handle; @@ -1096,16 +1100,16 @@ namespace CGAL { {} }; //**************************************************************************** - template + template class GMap_dart_iterator_of_orbit: public GMap_dart_iterator_of_orbit_generic + A1,A2,A3,A4,A5,A6,A7,A8,A9> { public: - typedef GMap_dart_iterator_of_orbit Self; + typedef GMap_dart_iterator_of_orbit Self; typedef GMap_dart_iterator_of_orbit_generic Base; + A1,A2,A3,A4,A5,A6,A7,A8,A9> Base; typedef typename Base::Dart_handle Dart_handle; typedef Tag_false Basic_iterator; ///< True iff this iterator is basic