1 <!DOCTYPE HTML PUBLIC
"-//W3C//DTD HTML 4.0.1 Transitional//EN">
5 <meta http-equiv=
"Content-Type" content=
"text/html; charset=ISO-8859-1">
6 <title>Boost.Flyweight Documentation - Key-value flyweights reference
</title>
7 <link rel=
"stylesheet" href=
"../style.css" type=
"text/css">
8 <link rel=
"start" href=
"../index.html">
9 <link rel=
"prev" href=
"flyweight.html">
10 <link rel=
"up" href=
"index.html">
11 <link rel=
"next" href=
"tags.html">
15 <h1><img src=
"../../../../boost.png" alt=
"Boost logo" align=
16 "middle" width=
"277" height=
"86">Key-value flyweights reference
</h1>
18 <div class=
"prev_link"><a href=
"flyweight.html"><img src=
"../prev.gif" alt=
"flyweight reference" border=
"0"><br>
19 <code>flyweight
</code> reference
21 <div class=
"up_link"><a href=
"index.html"><img src=
"../up.gif" alt=
"Boost.Flyweight reference" border=
"0"><br>
22 Boost.Flyweight reference
24 <div class=
"next_link"><a href=
"tags.html"><img src=
"../next.gif" alt=
"tags" border=
"0"><br>
26 </a></div><br clear=
"all" style=
"clear: all;">
33 <li><a href=
"#key_extractor">Key extractors
</a></li>
34 <li><a href=
"#key_value_fwd_synopsis">Header
35 <code>"boost/flyweight/key_value_fwd.hpp"</code> synopsis
</a>
37 <li><a href=
"#synopsis">Header
38 <code>"boost/flyweight/key_value.hpp"</code> synopsis
</a>
40 <li><a href=
"#key_value_construct">Class template
<code>key_value
</code></a></li>
45 <h2><a name=
"key_extractor">Key extractors
</a></h2>
48 Let
<code>Key
</code> be a type with some implicit equivalence relationship
49 and
<code>Value
</code> a type constructible from
<code>Key
</code>.
50 A
<a href=
"http://www.sgi.com/tech/stl/DefaultConstructible.html"><code>Default
51 Constructible
</code></a> type
<code>KeyFromValue
</code> is said
52 to be a key extractor from
<code>Value
</code> to
<code>Key
</code> if
54 <li><code>kfv(cv)
</code> is defined and have type
<code>const Key
&</code>,
</li>
55 <li><code>kfv(cv)
</code> is equivalent to
<code>kfv(Value(cv))
</code>,
</li>
56 <li><code>kfv(Value(k))
</code> is equivalent to
<code>k
</code>,
</li>
58 for every
<code>kfv
</code> of type
<code>const KeyFromValue
</code>,
59 <code>cv
</code> of type
<code>const Value
</code> and
60 <code>k
</code> of type
<code>Key
</code>.
63 <h2><a name=
"key_value_fwd_synopsis">Header
64 <a href=
"../../../../boost/flyweight/key_value_fwd.hpp"><code>"boost/flyweight/key_value_fwd.hpp"</code></a> synopsis
</a></h2>
67 <span class=keyword
>namespace
</span> <span class=identifier
>boost
</span><span class=special
>{
</span>
69 <span class=keyword
>namespace
</span> <span class=identifier
>flyweights
</span><span class=special
>{
</span>
71 <span class=keyword
>struct
</span> <span class=identifier
>no_key_from_value
</span><span class=special
>;
</span>
73 <span class=keyword
>template
</span><span class=special
><</span>
74 <span class=keyword
>typename
</span> <span class=identifier
>Key
</span><span class=special
>,
</span><span class=keyword
>typename
</span> <span class=identifier
>Value
</span><span class=special
>,
</span>
75 <span class=keyword
>typename
</span> <span class=identifier
>KeyFromValue
</span><span class=special
>=
</span><span class=identifier
>no_key_from_value
</span>
76 <span class=special
>></span>
77 <span class=keyword
>struct
</span> <span class=identifier
>key_value
</span><span class=special
>;
</span>
79 <span class=special
>}
</span> <span class=comment
>// namespace boost::flyweights
</span>
81 <span class=special
>}
</span> <span class=comment
>// namespace boost
</span>
84 <h2><a name=
"synopsis">Header
85 <a href=
"../../../../boost/flyweight/key_value.hpp"><code>"boost/flyweight/key_value.hpp"</code></a> synopsis
</a></h2>
87 <h3><a name=
"key_value_construct">Class template
<code>key_value
</code></a></h3>
90 In
<a href=
"flyweight.html#flyweight"><code>flyweight
</code></a> instantiations
91 of the form
<code>flyweight
<T,...
></code>, the associated
92 <code>key_type
</code> and
<code>value_type
</code> are both equal to
<code>T
</code>.
93 Instantiations of the form
<code>flyweight
<key_value
<Key,Value[,KeyFromValue]
>,...
></code>
94 allow to specify these types separately.
<code>Key
</code> and
<code>Value
</code>
95 must be different types. When provided,
<code>KeyFromValue
</code>
96 must be a
<a href=
"#key_extractor"><code>Key Extractor
</code></a> from
97 <code>Value
</code> to
<code>Key
</code>.
102 <div class=
"prev_link"><a href=
"flyweight.html"><img src=
"../prev.gif" alt=
"flyweight reference" border=
"0"><br>
103 <code>flyweight
</code> reference
105 <div class=
"up_link"><a href=
"index.html"><img src=
"../up.gif" alt=
"Boost.Flyweight reference" border=
"0"><br>
106 Boost.Flyweight reference
108 <div class=
"next_link"><a href=
"tags.html"><img src=
"../next.gif" alt=
"tags" border=
"0"><br>
110 </a></div><br clear=
"all" style=
"clear: all;">
114 <p>Revised September
15th
2008</p>
116 <p>© Copyright
2006-
2008 Joaqu
ín M L
ópez Mu
ñoz.
117 Distributed under the Boost Software
118 License, Version
1.0. (See accompanying file
<a href=
"../../../../LICENSE_1_0.txt">
119 LICENSE_1_0.txt
</a> or copy at
<a href=
"http://www.boost.org/LICENSE_1_0.txt">
120 http://www.boost.org/LICENSE_1_0.txt
</a>)