diff --git a/AABB_tree/include/CGAL/AABB_tree/AABB_tree.h b/AABB_tree/include/CGAL/AABB_tree/AABB_tree.h index 253e220de6d..0c203014192 100644 --- a/AABB_tree/include/CGAL/AABB_tree/AABB_tree.h +++ b/AABB_tree/include/CGAL/AABB_tree/AABB_tree.h @@ -240,7 +240,7 @@ public: Counting_iterator(int& i_) : i(i_) {}; struct Proxy { - Proxy& operator=(const Value_type&) {}; + Proxy& operator=(const Value_type&) { return *this; }; }; Proxy operator*() { @@ -249,30 +249,32 @@ public: Self& operator++() { ++i; + return *this; } Self& operator++(int) { ++i; + return *this; } }; // The following function template is restricted to that T can only be in // {Ray, Line, Segment}. It return type is int. // The trick uses enable_if and the Boost MPL. -// template -// typename boost::enable_if< -// typename boost::mpl::contains::type, -// int>::type -// count_intersections(const T& x) -// { -// typedef Listing_traits > Traits; -// int result; -// Counting_iterator counting_it(result); -// Traits traits(counting_it); -// m_root->template traversal(x, traits, m_data.size()); -// return result ; -// } + template + typename boost::enable_if< + typename boost::mpl::contains::type, + int>::type + count_intersections(const T& x) + { + typedef Listing_traits, Point> Traits; + int result = 0; + Counting_iterator counting_it(result); + Traits traits(counting_it); + m_root->template traversal(x, traits, m_data.size()); + return result ; + } }; // end class AABB_tree } // end namespace CGAL