3 Copyright (c) Jeremy Siek 2000
5 Distributed under the Boost Software License, Version 1.0.
6 (See accompanying file LICENSE_1_0.txt or copy at
7 http://www.boost.org/LICENSE_1_0.txt)
10 <Title>LvaluePropertyMap
</Title>
11 <BODY BGCOLOR=
"#ffffff" LINK=
"#0000ee" TEXT=
"#000000" VLINK=
"#551a8b"
13 <IMG SRC=
"../../../boost.png"
14 ALT=
"C++ Boost" width=
"277" height=
"86">
18 <H2><A NAME=
"concept:LvaluePropertyMap"></A>
22 The LvaluePropertyMap provides
<code>operator[]
</code> and function
<code>get()
</code> for accessing a
23 reference to a value object. The return type refines that of function
<code>get()
</code>in
<a
24 href=
"./ReadablePropertyMap.html">ReadablePropertyMap
</a>; it can only be a reference (for a
<I>mutable
</I> LvaluePropertyMap) or a const reference (for a
<I>non-mutable
</I> LvaluePropertyMap).
26 <H3>Refinement of
</H3>
28 <a href=
"./ReadablePropertyMap.html">ReadablePropertyMap
</a>
29 for non-mutable or
<a href=
"./ReadWritePropertyMap.html">ReadWritePropertyMap
</a> for mutable property map.
35 <TD><tt>PMap
</tt></TD>
36 <TD>A type that is a model of LvaluePropertyMap.
</TD>
39 <TD><tt>pmap
</tt></TD>
40 <TD>An object of type
<tt>PMap
</tt>.
</td>
44 <TD>An object of type
<tt>boost::property_traits
<PMap
>::key_type
</tt>.
</td>
50 <h3>Associated Types
</h3>
55 <td>Reference Type
</td>
56 <td><TT>boost::property_traits
<PMap
>::reference
</TT></td>
58 The reference type, which must be a reference or const reference to
59 the value type of the property map.
64 <td>Property Map Category
65 <td><TT>boost::property_traits
<PMap
>::category
</TT></td>
67 The category of the property: a type convertible to
68 <TT>boost::lvalue_property_map_tag
</TT>.
74 <h3>Valid Expressions
</h3>
78 <th>Name
</th><th>Expression
</th><th>Return Type
</th><th>Description
</th>
83 <td>Access Property Value
</td>
84 <TD><TT>pmap[key]
</TT></TD>
86 <TT>value_type
&</TT> for mutable,
<TT>const value_type
&</TT>
89 <TD>Obtain a reference to the value associated with
<TT>key
</TT>.
</TD>
93 <h3>Concept Checking Class
</h3>
95 <pre> template
<class PMap, class Key
>
96 struct LvaluePropertyMapConcept
98 typedef typename property_traits
<PMap
>::category Category;
99 typedef boost::lvalue_property_map_tag LvalueTag;
100 typedef const typename property_traits
<PMap
>::value_type
& const_reference;
102 function_requires
< ReadWritePropertyMapConcept
<PMap, Key
> >();
103 function_requires
< ConvertibleConcept
<Category, LvalueTag
> >();
105 const_reference ref = pmap[k];
111 template
<class PMap, class Key
>
112 struct Mutable_LvaluePropertyMapConcept
114 typedef typename property_traits
<PMap
>::category Category;
115 typedef boost::lvalue_property_map_tag LvalueTag;
116 typedef typename property_traits
<PMap
>::value_type
& reference;
118 function_requires
< ReadWritePropertyMapConcept
<PMap, Key
> >();
119 function_requires
<ConvertibleConcept
<Category, LvalueTag
> >();
121 reference ref = pmap[k];
129 <a href=
"./property_map.html">Property map concepts
</a>
136 <TD nowrap
>Copyright ©
2000</TD><TD>
137 <a HREF=
"http://www.boost.org/people/jeremy_siek.htm">Jeremy Siek
</a>, Univ.of Notre Dame (
<A HREF=
"mailto:jsiek@lsc.nd.edu">jsiek@lsc.nd.edu
</A>)