From b56c436ee60d7d9d63d1d778f98e113b207f8da7 Mon Sep 17 00:00:00 2001 From: Andreas Fabri Date: Mon, 25 Apr 2016 21:25:16 +0200 Subject: [PATCH] Use boost::lambda::constant() - thank you Philipp --- .../examples/AABB_tree/AABB_ray_shooting_example.cpp | 2 +- AABB_tree/include/CGAL/AABB_tree.h | 10 +++------- 2 files changed, 4 insertions(+), 8 deletions(-) diff --git a/AABB_tree/examples/AABB_tree/AABB_ray_shooting_example.cpp b/AABB_tree/examples/AABB_tree/AABB_ray_shooting_example.cpp index c5023f1ebe7..0804ae9a9e5 100644 --- a/AABB_tree/examples/AABB_tree/AABB_ray_shooting_example.cpp +++ b/AABB_tree/examples/AABB_tree/AABB_ray_shooting_example.cpp @@ -59,7 +59,7 @@ int main(int argc, char* argv[]) Vector v = CGAL::Polygon_mesh_processing::compute_face_normal(fd,mesh); Ray ray(p,d * v); - Ray_intersection intersection = tree.first_intersection(ray, Skip(fd)); + Ray_intersection intersection = tree.first_intersection(ray); if(intersection){ if(boost::get(&(intersection->first))){ const Point* p = boost::get(&(intersection->first) ); diff --git a/AABB_tree/include/CGAL/AABB_tree.h b/AABB_tree/include/CGAL/AABB_tree.h index 78df3478bd8..d3117a48094 100644 --- a/AABB_tree/include/CGAL/AABB_tree.h +++ b/AABB_tree/include/CGAL/AABB_tree.h @@ -29,6 +29,7 @@ #include #include #include +#include #ifdef CGAL_HAS_THREADS #include @@ -395,11 +396,6 @@ public: any_intersection(const Query& query) const; - struct False_functor { - template - bool operator()(const T&) const - { return false;} - }; /// Returns the intersection and primitive id closest to the source point of the ray /// query. @@ -421,7 +417,7 @@ public: boost::optional< typename Intersection_and_primitive_id::Type > first_intersection(const Ray& query) const { - return first_intersection(query, False_functor()); + return first_intersection(query, boost::lambda::constant(false)); } /// Returns the primitive id closest to the source point of the ray @@ -444,7 +440,7 @@ public: boost::optional first_intersected_primitive(const Ray& query) const { - return first_intersected_primitive(query, False_functor()); + return first_intersected_primitive(query, boost::lambda::constant(false)); } ///@}