Index: property_map.hpp =================================================================== --- property_map.hpp (revision 76962) +++ property_map.hpp (working copy) @@ -590,9 +590,60 @@ }; //========================================================================= - // A property map that applies the identity function to integers - typedef typed_identity_property_map identity_property_map; + // A property map returns a copy of the key + // It is overloaded to do so for any type + // but, consequently does not provide correct property_traits + struct identity_property_map + { + typedef size_t no_type; // should this be void instead? + typedef no_type key_type; + typedef no_type value_type; + typedef no_type reference; + typedef boost::readable_property_map_tag category; + template + inline T operator[](const T& k) const + { + return k; + } + }; + + template + T get(identity_property_map, const T& k) + { + return k; + } + + // A property map returns a reference to the key + // It is overloaded to do so for any type + // but, consequently does not provide correct property_traits + struct identity_ref_property_map + { + typedef size_t no_type;// should this be void instead? + typedef no_type key_type; + typedef no_type value_type; + typedef no_type reference; + typedef boost::lvalue_property_map_tag category; + + template + inline T& operator[](T& k) const + { + return k; + } + }; + + template + T& get(identity_ref_property_map, T& k) + { + return k; + } + + template + void put(identity_ref_property_map, T& k, const T& v) + { + k = v; + } + //========================================================================= // A property map that does not do anything, for // when you have to supply a property map, but don't need it.