1<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> 2<html> 3<head> 4<meta http-equiv="Content-Type" content="text/html; charset=UTF-8"> 5<title>Concept Assignable</title> 6<link rel="stylesheet" href="../../doc/src/boostbook.css" type="text/css"> 7<meta name="generator" content="DocBook XSL Stylesheets V1.79.1"> 8<link rel="home" href="index.html" title="The Boost C++ Libraries BoostBook Documentation Subset"> 9<link rel="up" href="concept_check.html#concepts.reference" title="Concept reference"> 10<link rel="prev" href="concept_check.html" title="Chapter 48. Boost.Concept_Check"> 11<link rel="next" href="InputIterator.html" title="Concept InputIterator"> 12</head> 13<body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF"> 14<table cellpadding="2" width="100%"><tr> 15<td valign="top"><img alt="Boost C++ Libraries" width="277" height="86" src="../../boost.png"></td> 16<td align="center"><a href="../../index.html">Home</a></td> 17<td align="center"><a href="../../libs/libraries.htm">Libraries</a></td> 18<td align="center"><a href="http://www.boost.org/users/people.html">People</a></td> 19<td align="center"><a href="http://www.boost.org/users/faq.html">FAQ</a></td> 20<td align="center"><a href="../../more/index.htm">More</a></td> 21</tr></table> 22<hr> 23<div class="spirit-nav"> 24<a accesskey="p" href="concept_check.html"><img src="../../doc/src/images/prev.png" alt="Prev"></a><a accesskey="u" href="concept_check.html#concepts.reference"><img src="../../doc/src/images/up.png" alt="Up"></a><a accesskey="h" href="index.html"><img src="../../doc/src/images/home.png" alt="Home"></a><a accesskey="n" href="InputIterator.html"><img src="../../doc/src/images/next.png" alt="Next"></a> 25</div> 26<div class="refentry"> 27<a name="Assignable"></a><div class="titlepage"></div> 28<div class="refnamediv"> 29<h2><span class="refentrytitle">Concept Assignable</span></h2> 30<p>Assignable</p> 31</div> 32<div class="refsect1"> 33<a name="id-1.3.49.3.4.3"></a><h2>Description</h2> 34<p>Assignable types must have copy constructors, 35 <code class="computeroutput">operator=</code> for assignment, and the <code class="computeroutput">swap()</code> 36 function defined.</p> 37</div> 38<div class="refsect1"> 39<a name="id-1.3.49.3.4.4"></a><h2>Refinement of</h2> 40<div class="itemizedlist"><ul class="itemizedlist" style="list-style-type: disc; "><li class="listitem"><p><a class="link" href="CopyConstructible.html" title="Concept CopyConstructible">CopyConstructible</a></p></li></ul></div> 41</div> 42<div class="refsect1"> 43<a name="id-1.3.49.3.4.5"></a><h2>Notation</h2> 44<div class="variablelist"><dl class="variablelist"> 45<dt><span class="term">X</span></dt> 46<dd>A type playing the role of assignable-type in the <a class="link" href="Assignable.html" title="Concept Assignable">Assignable</a> concept.</dd> 47<dt> 48<span class="term"><code class="varname">x</code>, </span><span class="term"><code class="varname">y</code></span> 49</dt> 50<dd>Objects of type X</dd> 51</dl></div> 52</div> 53<div class="refsect1"> 54<a name="id-1.3.49.3.4.6"></a><h2>Valid expressions</h2> 55<div class="informaltable"><table class="table"> 56<colgroup> 57<col> 58<col> 59<col> 60<col> 61</colgroup> 62<thead><tr> 63<th>Name</th> 64<th>Expression</th> 65<th>Type</th> 66<th>Semantics</th> 67</tr></thead> 68<tbody> 69<tr> 70<td><p>Assignment</p></td> 71<td><p>x = y</p></td> 72<td><p><span class="type">X &</span></p></td> 73<td><p>Require <code class="computeroutput">operator=</code></p></td> 74</tr> 75<tr> 76<td><p>Swap</p></td> 77<td><p>swap(x, y)</p></td> 78<td><p><span class="type">void</span></p></td> 79<td><p>Require <code class="computeroutput">swap()</code> function</p></td> 80</tr> 81</tbody> 82</table></div> 83</div> 84<div class="refsect1"> 85<a name="id-1.3.49.3.4.7"></a><h2>Models</h2> 86<div class="itemizedlist"><ul class="itemizedlist" style="list-style-type: disc; "><li class="listitem"><span class="simplelist"><span class="type">int</span></span></li></ul></div> 87</div> 88<div class="refsect1"> 89<a name="id-1.3.49.3.4.8"></a><h2>See also</h2> 90<div class="itemizedlist"><ul class="itemizedlist" style="list-style-type: disc; "><li class="listitem"><p><a class="link" href="CopyConstructible.html" title="Concept CopyConstructible">CopyConstructible</a></p></li></ul></div> 91</div> 92</div> 93<table xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" width="100%"><tr> 94<td align="left"></td> 95<td align="right"><div class="copyright-footer">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<p>Distributed under the Boost Software License, Version 1.0. 96 (See accompanying file <code class="filename">LICENSE_1_0.txt</code> or copy at 97 <a href="http://www.boost.org/LICENSE_1_0.txt" target="_top">http://www.boost.org/LICENSE_1_0.txt</a>) 98 </p> 99<p>This product includes software developed at the University 100 of Notre Dame and the Pervasive Technology Labs at Indiana 101 University. For technical information contact Andrew Lumsdaine 102 at the Pervasive Technology Labs at Indiana University. For 103 administrative and license questions contact the Advanced 104 Research and Technology Institute at 351 West 10th Street. 105 Indianapolis, Indiana 46202, phone 317-278-4100, fax 106 317-274-5902.</p> 107<p>Some concepts based on versions from the MTL draft manual 108 and Boost Graph and Property Map documentation, the SGI Standard 109 Template Library documentation and the Hewlett-Packard STL, 110 under the following license: 111 </p> 112<div class="blockquote"><blockquote class="blockquote"><p>Permission to use, copy, modify, distribute and 113 sell this software and its documentation for any purpose is 114 hereby granted without fee, provided that the above copyright 115 notice appears in all copies and that both that copyright 116 notice and this permission notice appear in supporting 117 documentation. Silicon Graphics makes no representations 118 about the suitability of this software for any purpose. It is 119 provided "as is" without express or implied 120 warranty.</p></blockquote></div> 121</div></td> 122</tr></table> 123<hr> 124<div class="spirit-nav"> 125<a accesskey="p" href="concept_check.html"><img src="../../doc/src/images/prev.png" alt="Prev"></a><a accesskey="u" href="concept_check.html#concepts.reference"><img src="../../doc/src/images/up.png" alt="Up"></a><a accesskey="h" href="index.html"><img src="../../doc/src/images/home.png" alt="Home"></a><a accesskey="n" href="InputIterator.html"><img src="../../doc/src/images/next.png" alt="Next"></a> 126</div> 127</body> 128</html> 129