// //======================================================================= // 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 // https://www.boost.org/LICENSE_1_0.txt) //======================================================================= // // $URL$ // $Id$ // SPDX-License-Identifier: BSL-1.0 // // Note: This file was copied from Boost v1.64 because it was introduced // in a release (~v1.51) that is newer than the oldest release of Boost // that CGAL supports. // the property map 'function_property_map' is (currently) used // in the packages Triangulation_2 and Triangulation_3. #ifndef CGAL_INTERNAL_BOOST_PROPERTY_MAP_FUNCTION_PROPERTY_MAP_HPP #define CGAL_INTERNAL_BOOST_PROPERTY_MAP_FUNCTION_PROPERTY_MAP_HPP #include #include #include #include #include #include #include namespace CGAL { namespace internal { namespace boost_ { 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::is_const > >, boost::lvalue_property_map_tag, boost::readable_property_map_tag>::type category; function_property_map(Func f = Func()) : f(f) {} reference operator[](const Key& 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); } } // boost_ } // internal } // CGAL #endif /* CGAL_INTERNAL_BOOST_PROPERTY_MAP_FUNCTION_PROPERTY_MAP_HPP */