diff options
Diffstat (limited to 'utils/lvalue_pmap.h')
-rwxr-xr-x | utils/lvalue_pmap.h | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/utils/lvalue_pmap.h b/utils/lvalue_pmap.h index 03ddf5e7..5b9403c0 100755 --- a/utils/lvalue_pmap.h +++ b/utils/lvalue_pmap.h @@ -3,7 +3,7 @@ #include <boost/property_map/property_map.hpp> -// i checked: boost provides get and put given [] +// i checked: boost provides get and put given [] - but it's not being found by ADL so instead i define them myself // lvalue property map pmapname<P> that is: P p; valtype &v=p->name; #define PMAP_MEMBER_INDIRECT(pmapname,valtype,name) template <class P> struct pmapname { \ @@ -12,6 +12,9 @@ typedef value_type & reference; \ typedef boost::lvalue_property_map_tag category; \ reference operator[](key_type p) const { return p->name; } \ + typedef pmapname<P> self_type; \ + friend inline value_type const& get(self_type const&,key_type p) { return p->name; } \ + friend inline void put(self_type &,key_type p,value_type const& v) { p->name = v; } \ }; #define PMAP_MEMBER_INDIRECT_2(pmapname,name) template <class P,class R> struct pmapname { \ @@ -20,6 +23,9 @@ typedef value_type & reference; \ typedef boost::lvalue_property_map_tag category; \ reference operator[](key_type p) const { return p->name; } \ + typedef pmapname<P,R> self_type; \ + friend inline value_type const& get(self_type const&,key_type p) { return p->name; } \ + friend inline void put(self_type &,key_type p,value_type const& v) { p->name = v; } \ }; #endif |