## ReadablePropertyMap

A ReadablePropertyMap provides read-access to the value object associated with a given key via a call to the `get()` function. The `get()` function returns a copy of the value object.

### Refinement of

CopyConstructible

### 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

Value Type | `boost::property_traits<PMap>::value_type` | The type of the property.
Key Type | `boost::property_traits<PMap>::key_type` | The type of the key object used to look up the property. The property map may be templated on the key type, in which case this typedef can be `void`.
Property Map Category | `boost::property_traits<PMap>::category` | The category of the property: a type convertible to `readable_property_map_tag`.

### Valid Expressions

Name | Expression | Return Type | Description
--- | --- | --- | ---
Get Property Value | `get(pmap, key)` | `value_type` | Lookup the property of the object identified by `key`.

### Concept Checking Class

      template <class PMap, class Key>
      struct ReadablePropertyMapConcept
      {
        typedef typename property_traits<PMap>::key_type key_type;
        typedef typename property_traits<PMap>::category Category;
        typedef boost::readable_property_map_tag ReadableTag;
        void constraints() {
          function_requires< ConvertibleConcept<Category, ReadableTag> >();

          val = get(pmap, k);
        }
        PMap pmap;
        Key k;
        typename property_traits<PMap>::value_type val;
      };

### See Also

Property map concepts

### Design Notes

At various times the name "read-only" was considered for this concept. However, that name is inappropriate because concepts are inherently positive, not negative. This becomes obvious when we define the ReadWritePropertyMap, which refines both the ReadablePropertyMap and the WritablePropertyMap concept. It would not make much sense to combine "read-only" and "write-only" concepts!

Copyright © 2000 | Jeremy Siek, Univ.of Notre Dame (jsiek@lsc.nd.edu)