From ed747f4c46ec8f061e16a9b4e75cd2f7fa9fc75b Mon Sep 17 00:00:00 2001 From: Guillaume Damiand Date: Fri, 10 Jun 2022 18:41:59 +0200 Subject: [PATCH] Change type of iterator for attributes --- .../internal/Combinatorial_map_utility.h | 30 ++++++++++++------- 1 file changed, 19 insertions(+), 11 deletions(-) diff --git a/Combinatorial_map/include/CGAL/Combinatorial_map/internal/Combinatorial_map_utility.h b/Combinatorial_map/include/CGAL/Combinatorial_map/internal/Combinatorial_map_utility.h index def9ea8e6c9..edde17c5ede 100644 --- a/Combinatorial_map/include/CGAL/Combinatorial_map/internal/Combinatorial_map_utility.h +++ b/Combinatorial_map/include/CGAL/Combinatorial_map/internal/Combinatorial_map_utility.h @@ -433,18 +433,29 @@ namespace CGAL typedef typename CMap::template Container_for_attributes type; }; + template + struct Iterator_type + { + using type=typename Container::iterator; + using const_type=typename Container::const_iterator; + }; + + template + struct Iterator_type + { + using type=typename Container::Index; + using const_type=typename Container::Index; + }; + // defines as type Compact_container::iterator template struct Add_compact_container_iterator{ typedef std::allocator_traits Allocator_traits; typedef typename Allocator_traits::template rebind_alloc Attr_allocator; - typedef typename CMap::template Container_for_attributes::iterator - iterator_type; // TODO? case when there is no Use_index typedef in CMap - typedef typename boost::mpl::if_ - < typename boost::is_same::type, - typename CMap::Dart_descriptor, iterator_type >::type type; + using type=typename Iterator_type, typename CMap::Use_index>::type; }; // defines as type Compact_container::const_iterator @@ -452,12 +463,9 @@ namespace CGAL struct Add_compact_container_const_iterator{ typedef std::allocator_traits Allocator_traits; typedef typename Allocator_traits::template rebind_alloc Attr_allocator; - typedef typename CMap::template Container_for_attributes:: - const_iterator iterator_type; - typedef typename boost::mpl::if_ - < typename boost::is_same::type, - typename CMap::Dart_const_descriptor, iterator_type >::type type; + using type=typename Iterator_type, typename CMap::Use_index>::const_type; }; // All the attributes (with CGAL::Void) @@ -541,7 +549,7 @@ namespace CGAL struct Attribute_descriptor { typedef typename CMap::Dart_index type; }; - // Helper class allowing to retreive the d-cell-const handle attribute + // Helper class allowing to retreive the d-cell-const handle attribute template::type> struct Attribute_const_descriptor {