// //======================================================================= // Author: Philipp Moeller // // Copyright 2012, Philipp Moeller // // Distributed under the Boost Software License, Version 1.0. (See // accompanying file LICENSE_1_0.txt or copy at // http://www.boost.org/LICENSE_1_0.txt) //======================================================================= // #ifndef CGAL_PROPERTY_MAP_FUNCTION_PROPERTY_MAP_H #define CGAL_PROPERTY_MAP_FUNCTION_PROPERTY_MAP_H // This is only in boost from 1.50 onward, so it is included here. It // has a different include guard and is in a different namespace as // well to prevent it from affecting users. #include #include #include #include #include #include #include namespace CGAL { template::type> class function_property_map: public boost::put_get_helper > { public: typedef Key key_type; typedef Ret reference; typedef typename boost::remove_cv::type>::type value_type; typedef typename boost::mpl::if_< boost::mpl::and_< boost::is_reference, boost::mpl::not_ > >, boost::lvalue_property_map_tag, boost::readable_property_map_tag>::type category; function_property_map(Func f = Func()) : f(f) {} reference operator[](key_type k) const { return f(k); } private: Func f; }; template function_property_map make_function_property_map(const Func& f) { return function_property_map(f); } template function_property_map make_function_property_map(const Func& f) { return function_property_map(f); } } // CGAL #endif /* CGAL_PROPERTY_MAP_FUNCTION_PROPERTY_MAP_H */