|
Boost-Commit : |
Subject: [Boost-commit] svn:boost r56301 - trunk/boost/property_map
From: jewillco_at_[hidden]
Date: 2009-09-18 16:12:37
Author: jewillco
Date: 2009-09-18 16:12:36 EDT (Fri, 18 Sep 2009)
New Revision: 56301
URL: http://svn.boost.org/trac/boost/changeset/56301
Log:
Added missing function
Text files modified:
trunk/boost/property_map/property_map.hpp | 16 ++++++++++++++++
1 files changed, 16 insertions(+), 0 deletions(-)
Modified: trunk/boost/property_map/property_map.hpp
==============================================================================
--- trunk/boost/property_map/property_map.hpp (original)
+++ trunk/boost/property_map/property_map.hpp 2009-09-18 16:12:36 EDT (Fri, 18 Sep 2009)
@@ -581,6 +581,22 @@
value_type c;
};
+ // Convert a Readable property map into a function object
+ template <typename PropMap>
+ class property_map_function {
+ PropMap pm;
+ typedef typename property_traits<PropMap>::key_type param_type;
+ public:
+ explicit property_map_function(const PropMap& pm): pm(pm) {}
+ typedef typename property_traits<PropMap>::value_type result_type;
+ result_type operator()(const param_type& k) const {return get(pm, k);}
+ };
+
+ template <typename PropMap>
+ property_map_function<PropMap>
+ make_property_map_function(const PropMap& pm) {
+ return property_map_function<PropMap>(pm);
+ }
} // namespace boost
Boost-Commit list run by bdawes at acm.org, david.abrahams at rcn.com, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk