VR-Forces 4.3 Class Documentation
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
functionPropertyMap.h
Go to the documentation of this file.
1 
2 //=======================================================================
10 //=======================================================================
12 
13 //NOTE: This is copied from boost 1.51, and renamed so it should not
16 
17 #pragma once
18 
19 #include <boost/config.hpp>
20 #include <boost/property_map/property_map.hpp>
21 #include <boost/type_traits.hpp>
22 #include <boost/utility/result_of.hpp>
23 #include <boost/mpl/and.hpp>
24 #include <boost/mpl/not.hpp>
25 #include <utility>
26 
27 namespace boost {
28 
29  template<typename Func, typename Key, typename Ret = typename boost::result_of<const Func(const Key&)>::type>
30  class DtFunctionPropertyMap: public put_get_helper<Ret, DtFunctionPropertyMap<Func, Key, Ret> > {
31  public:
32  typedef Key key_type;
33  typedef Ret reference;
34  typedef typename boost::remove_cv<typename boost::remove_reference<Ret>::type>::type value_type;
35 
36  typedef typename boost::mpl::if_<
37  boost::mpl::and_<
38  boost::is_reference<Ret>,
39  boost::mpl::not_<boost::is_const<Ret> >
40  >,
41  boost::lvalue_property_map_tag,
42  boost::readable_property_map_tag>::type
44 
45  DtFunctionPropertyMap(Func f = Func()) : f(f) {}
46 
47  reference operator[](const Key& k) const {
48  return f(k);
49  }
50 
51  private:
52  Func f;
53  };
54 
55  template<typename Key, typename Func>
57  DtMakeFunctionPropertyMap(const Func& f) {
59  }
60 
61  template<typename Key, typename Ret, typename Func>
62  DtFunctionPropertyMap<Func, Key, Ret>
63  DtMakeFunctionPropertyMap(const Func& f) {
65  }
66 
67 }

Document ID: Generated on Wed Mar 11 21:20:57 EDT 2015 from SVN revision 150940
Copyright © 2005-2014 VT MÄK. All Rights Reserved (www.mak.com)