Lvalue Property Map
An Lvalue Property Map provides the get() function and operator[] to obtain a reference to the value associated with a key.
Refinement of
ReadablePropertyMap
Notation
PMap |
A type that is a model of LvaluePropertyMap. |
pmap |
An object of type PMap. |
key |
An object of type boost::property_traits<PMap>::key_type. |
Associated Types
Reference Type |
boost::property_traits<PMap>::reference |
Must be equal to value_type& or const value_type&. |
Property Map Category
| boost::property_traits<PMap>::category |
Must be convertible to
boost::lvalue_property_map_tag.
|
Valid Expressions
Name | Expression | Return Type | Description |
Access Property Value |
pmap[key] |
boost::property_traits<PMap>::reference |
Access the value associated with key by reference. |
Concept Checking Class
template <class PMap, class Key>
struct LvaluePropertyMapConcept
{
typedef typename property_traits<PMap>::category Category;
typedef boost::lvalue_property_map_tag LvalueTag;
typedef const typename property_traits<PMap>::value_type& const_reference;
void constraints() {
function_requires< ReadWritePropertyMapConcept<PMap, Key> >();
function_requires< ConvertibleConcept<Category, LvalueTag> >();
const_reference ref = pmap[k];
}
PMap pmap;
Key k;
};
See Also
Property map concepts - Readable Property Map - Writable Property Map - Read / Write Property Map - Mutable Lvalue Property Map