diff --git a/BGL/include/CGAL/boost/graph/properties_Polyhedron_3.h b/BGL/include/CGAL/boost/graph/properties_Polyhedron_3.h index 350a479bfd2..9514b2bb4bb 100644 --- a/BGL/include/CGAL/boost/graph/properties_Polyhedron_3.h +++ b/BGL/include/CGAL/boost/graph/properties_Polyhedron_3.h @@ -24,6 +24,7 @@ #include #include #include +#include #define CGAL_HDS_PARAM_ template < class Traits, class Items, class Alloc> class HDS @@ -41,13 +42,17 @@ public: typedef std::size_t reference; typedef Handle key_type; +private: + typedef CGAL::Unique_hash_map Map; + +public: template Polyhedron_index_map_external(InputIterator begin, InputIterator end, std::size_t max) - : map_(begin, end, 0, std::size_t(-1), max) {} + : map_(new Map(begin, end, 0, std::size_t(-1), max)) {} - reference operator[](const key_type& k) const { return map_[k]; } + reference operator[](const key_type& k) const { return (*map_)[k]; } private: - CGAL::Unique_hash_map map_; + boost::shared_ptr map_; }; // Special case for edges. @@ -61,18 +66,22 @@ public: typedef std::size_t reference; typedef typename boost::graph_traits::edge_descriptor key_type; +private: + typedef CGAL::Unique_hash_map Map; + +public: Polyhedron_edge_index_map_external(Polyhedron& p) - : map_(std::size_t(-1), num_halfedges(p)) + : map_(new Map(std::size_t(-1), num_halfedges(p))) { unsigned int data = 0; typename boost::graph_traits::edge_iterator it, end; for(boost::tie(it, end) = edges(p); it != end; ++it, ++data) - map_[*it] = data; + (*map_)[*it] = data; } - reference operator[](const key_type& k) const { return map_[k]; } + reference operator[](const key_type& k) const { return (*map_)[k]; } private: - CGAL::Unique_hash_map map_; + boost::shared_ptr map_; }; template