1 | <html> |
---|
2 | <head> |
---|
3 | <meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1"> |
---|
4 | <title>Concept Assignable</title> |
---|
5 | <link rel="stylesheet" href="boostbook.css" type="text/css"> |
---|
6 | <meta name="generator" content="DocBook XSL Stylesheets V1.68.1"> |
---|
7 | <link rel="start" href="index.html" title="The Boost C++ Libraries BoostBook Documentation Subset"> |
---|
8 | <link rel="up" href="id620092-bb.html#concepts.reference" title="Concept reference"> |
---|
9 | <link rel="prev" href="id620092-bb.html#concepts.reference" title="Concept reference"> |
---|
10 | <link rel="next" href="InputIterator.html" title="Concept InputIterator"> |
---|
11 | </head> |
---|
12 | <body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF"> |
---|
13 | <table cellpadding="2" width="100%"> |
---|
14 | <td valign="top"><img alt="Boost C++ Libraries" width="277" height="86" src="../../boost.png"></td> |
---|
15 | <td align="center"><a href="../../index.htm">Home</a></td> |
---|
16 | <td align="center"><a href="../../libs/libraries.htm">Libraries</a></td> |
---|
17 | <td align="center"><a href="../../people/people.htm">People</a></td> |
---|
18 | <td align="center"><a href="../../more/faq.htm">FAQ</a></td> |
---|
19 | <td align="center"><a href="../../more/index.htm">More</a></td> |
---|
20 | </table> |
---|
21 | <hr> |
---|
22 | <div class="spirit-nav"> |
---|
23 | <a accesskey="p" href="id620092-bb.html#concepts.reference"><img src="images/prev.png" alt="Prev"></a><a accesskey="u" href="id620092-bb.html#concepts.reference"><img src="images/up.png" alt="Up"></a><a accesskey="h" href="index.html"><img src="images/home.png" alt="Home"></a><a accesskey="n" href="InputIterator.html"><img src="images/next.png" alt="Next"></a> |
---|
24 | </div> |
---|
25 | <div class="refentry" lang="en"> |
---|
26 | <a name="Assignable"></a><div class="titlepage"></div> |
---|
27 | <div class="refnamediv"> |
---|
28 | <h2><span class="refentrytitle">Concept Assignable</span></h2> |
---|
29 | <p>Assignable</p> |
---|
30 | </div> |
---|
31 | <div class="refsect1" lang="en"> |
---|
32 | <a name="id942373"></a><h2>Description</h2> |
---|
33 | <p>Assignable types must have copy constructors, |
---|
34 | <code class="computeroutput">operator=</code> for assignment, and the <code class="computeroutput">swap()</code> |
---|
35 | function defined.</p> |
---|
36 | </div> |
---|
37 | <div class="refsect1" lang="en"> |
---|
38 | <a name="id942394"></a><h2>Refinement of</h2> |
---|
39 | <div class="itemizedlist"><ul type="disc"><li><p><a href="CopyConstructible.html" title="Concept CopyConstructible">CopyConstructible</a></p></li></ul></div> |
---|
40 | </div> |
---|
41 | <div class="refsect1" lang="en"> |
---|
42 | <a name="id942407"></a><h2>Notation</h2> |
---|
43 | <div class="variablelist"><dl> |
---|
44 | <dt><span class="term">X</span></dt> |
---|
45 | <dd>A type playing the role of assignable-type in the <a href="Assignable.html" title="Concept Assignable">Assignable</a> concept.</dd> |
---|
46 | <dt> |
---|
47 | <span class="term"><code class="varname">x</code>, </span><span class="term"><code class="varname">y</code></span> |
---|
48 | </dt> |
---|
49 | <dd>Objects of type X</dd> |
---|
50 | </dl></div> |
---|
51 | </div> |
---|
52 | <div class="refsect1" lang="en"> |
---|
53 | <a name="id942437"></a><h2>Valid expressions</h2> |
---|
54 | <div class="informaltable"><table class="table"> |
---|
55 | <colgroup> |
---|
56 | <col> |
---|
57 | <col> |
---|
58 | <col> |
---|
59 | <col> |
---|
60 | </colgroup> |
---|
61 | <thead><tr> |
---|
62 | <th>Name</th> |
---|
63 | <th>Expression</th> |
---|
64 | <th>Type</th> |
---|
65 | <th>Semantics</th> |
---|
66 | </tr></thead> |
---|
67 | <tbody> |
---|
68 | <tr> |
---|
69 | <td><p>Assignment</p></td> |
---|
70 | <td><p>x = y</p></td> |
---|
71 | <td><p><span class="type">X &</span></p></td> |
---|
72 | <td><p>Require <code class="computeroutput">operator=</code></p></td> |
---|
73 | </tr> |
---|
74 | <tr> |
---|
75 | <td><p>Swap</p></td> |
---|
76 | <td><p>swap(x, y)</p></td> |
---|
77 | <td><p><span class="type">void</span></p></td> |
---|
78 | <td><p>Require <code class="computeroutput">swap()</code> function</p></td> |
---|
79 | </tr> |
---|
80 | </tbody> |
---|
81 | </table></div> |
---|
82 | </div> |
---|
83 | <div class="refsect1" lang="en"> |
---|
84 | <a name="id942500"></a><h2>Models</h2> |
---|
85 | <div class="itemizedlist"><ul type="disc"><li><span class="simplelist"><span class="type">int</span></span></li></ul></div> |
---|
86 | </div> |
---|
87 | <div class="refsect1" lang="en"> |
---|
88 | <a name="id942512"></a><h2>See also</h2> |
---|
89 | <div class="itemizedlist"><ul type="disc"><li><p><a href="CopyConstructible.html" title="Concept CopyConstructible">CopyConstructible</a></p></li></ul></div> |
---|
90 | </div> |
---|
91 | </div> |
---|
92 | <table width="100%"><tr> |
---|
93 | <td align="left"></td> |
---|
94 | <td align="right"><small>Copyright © 2001, 2002 Indiana University<br>Copyright © 2000, 2001 University of Notre Dame du Lac<br>Copyright © 2000 Jeremy Siek, Lie-Quan Lee, Andrew Lumsdaine<br>Copyright © 1996-1999 Silicon Graphics Computer Systems, Inc.<br>Copyright © 1994 Hewlett-Packard Company</small></td> |
---|
95 | </tr></table> |
---|
96 | <hr> |
---|
97 | <div class="spirit-nav"> |
---|
98 | <a accesskey="p" href="id620092-bb.html#concepts.reference"><img src="images/prev.png" alt="Prev"></a><a accesskey="u" href="id620092-bb.html#concepts.reference"><img src="images/up.png" alt="Up"></a><a accesskey="h" href="index.html"><img src="images/home.png" alt="Home"></a><a accesskey="n" href="InputIterator.html"><img src="images/next.png" alt="Next"></a> |
---|
99 | </div> |
---|
100 | </body> |
---|
101 | </html> |
---|