diff --git a/AABB_tree/include/CGAL/AABB_HalfedgeGraph_segment_primitive.h b/AABB_tree/include/CGAL/AABB_HalfedgeGraph_segment_primitive.h index 8809ef16d9b..36e44f7a972 100644 --- a/AABB_tree/include/CGAL/AABB_HalfedgeGraph_segment_primitive.h +++ b/AABB_tree/include/CGAL/AABB_HalfedgeGraph_segment_primitive.h @@ -37,7 +37,18 @@ #include namespace CGAL { + +namespace internal{ + template ::value> + struct Extract_value_type_of_iterator{ + struct value_type{}; + }; + template + struct Extract_value_type_of_iterator{ + typedef typename std::iterator_traits::value_type value_type; + }; +} template < class HalfedgeGraph, class cache_primitive=Tag_false, @@ -59,15 +70,13 @@ class AABB_HalfedgeGraph_segment_primitive : public AABB_primitive< Id_, public: // constructors AABB_HalfedgeGraph_segment_primitive(Id_ it) : Base(it){} + //the enable_if is required here so that the first overload is chosen when an Edge_iterator is provided template AABB_HalfedgeGraph_segment_primitive(Iterator it, typename boost::enable_if< - boost::mpl::and_< - boost::integral_constant::value >, - boost::is_convertible< - typename std::iterator_traits::value_type, - std::pair - > + boost::is_convertible< + typename internal::Extract_value_type_of_iterator::value_type, + std::pair > >::type* = NULL ) : Base( it->second,