All Classes Namespaces Files Functions Variables Typedefs Enumerations Friends Macros Pages
property_map.hpp
Go to the documentation of this file.
1 //=======================================================================
2 // Copyright (c) 2013 Robert Rosolek
3 //
4 // Distributed under the Boost Software License, Version 1.0. (See
5 // accompanying file LICENSE_1_0.txt or copy at
6 // http://www.boost.org/LICENSE_1_0.txt)
7 //=======================================================================
15 #ifndef PAAL_PROPERTY_MAP_HPP
16 #define PAAL_PROPERTY_MAP_HPP
17 
19 
20 #include <utility>
21 
22 namespace paal {
23 namespace utils {
24 
25  // TODO use this in include/paal/steiner_tree/zelikovsky_11_per_6.hpp
34  template<class Map>
36  Map m_map;
37 
38  public:
39 
45  property_map_get(Map map) : m_map(map) {}
46 
55  template <class Key>
56  auto operator()(Key&& key) const ->
57  puretype(get(m_map, std::forward<Key>(key)))
58  {
59  return get(m_map, std::forward<Key>(key));
60  }
61  };
62 
71  template <class Map>
73  {
74  return property_map_get<Map>(map);
75  }
76 
77 }
78 }
79 
80 #endif /* PAAL_PROPERTY_MAP_HPP */
property_map_get(Map map)
constructor
#define puretype(t)
for given expression returns its type with removed const and reference
Functor object for property map get. This class exists because std::bind can&#39;t be used with polymorph...
auto operator()(Key &&key) const -> puretype(get(m_map, std::forward< Key >(key)))
operator
property_map_get< Map > make_property_map_get(Map map)
make for property_map_get