1 <!DOCTYPE html PUBLIC
"-//W3C//DTD HTML 4.01 Transitional//EN">
5 <meta http-equiv=
"Content-Language" content=
"en-us">
6 <meta http-equiv=
"Content-Type" content=
"text/html; charset=us-ascii">
8 <title>Copy Constructible
</title>
11 <body bgcolor=
"#FFFFFF" link=
"#0000EE" text=
"#000000" vlink=
"#551A8B" alink=
13 <img src=
"../../boost.png" alt=
"C++ Boost" width=
"277" height=
14 "86"><br clear=
"none">
16 <h1>Copy Constructible
</h1>
20 <p>A type is Copy Constructible if it is possible to copy objects of that
27 <td valign=
"top"><tt>T
</tt></td>
29 <td valign=
"top">is type that is a model of Copy Constructible
</td>
33 <td valign=
"top"><tt>t
</tt></td>
35 <td valign=
"top">is an object of type
<tt>T
</tt></td>
39 <td valign=
"top"><tt>u
</tt></td>
41 <td valign=
"top">is an object of type
<tt>const T
</tt></td>
47 <h3>Valid expressions
</h3>
49 <table border
summary=
"">
61 <td valign=
"top">Copy constructor
</td>
63 <td valign=
"top"><tt>T(t)
</tt></td>
65 <td valign=
"top"><tt>T
</tt></td>
67 <td valign=
"top"><tt>t
</tt> is equivalent to
<tt>T(t)
</tt></td>
71 <td valign=
"top">Copy constructor
</td>
79 <td valign=
"top"><tt>T
</tt></td>
81 <td valign=
"top"><tt>u
</tt> is equivalent to
<tt>T(u)
</tt></td>
85 <td valign=
"top">Destructor
</td>
93 <td valign=
"top"><tt>T
</tt></td>
95 <td valign=
"top"> </td>
99 <td valign=
"top">Address Operator
</td>
107 <td valign=
"top"><tt>T*
</tt></td>
109 <td valign=
"top">denotes the address of
<tt>t
</tt></td>
113 <td valign=
"top">Address Operator
</td>
121 <td valign=
"top"><tt>T*
</tt></td>
123 <td valign=
"top">denotes the address of
<tt>u
</tt></td>
130 <li><tt>int
</tt></li>
132 <li><tt>std::pair
</tt></li>
135 <h3>Concept Checking Class
</h3>
137 template
<class T
>
138 struct CopyConstructibleConcept
141 T a(b); // require copy constructor
142 T* ptr =
&a; // require address of operator
143 const_constraints(a);
144 ignore_unused_variable_warning(ptr);
146 void const_constraints(const T
& a) {
147 T c(a); // require const copy constructor
148 const T* ptr =
&a; // require const address of operator
149 ignore_unused_variable_warning(c);
150 ignore_unused_variable_warning(ptr);
158 <p><a href=
"http://www.sgi.com/tech/stl/DefaultConstructible.html">Default
159 Constructible
</a> and
<a href=
"./Assignable.html">Assignable
</a><br></p>
162 <p><a href=
"http://validator.w3.org/check?uri=referer"><img border=
"0" src=
163 "../../doc/images/valid-html401.png" alt=
"Valid HTML 4.01 Transitional"
164 height=
"31" width=
"88"></a></p>
167 <!--webbot bot="Timestamp" s-type="EDITED" s-format="%d %B, %Y" startspan -->05
168 December,
2006<!--webbot bot="Timestamp" endspan i-checksum="38516" --></p>
172 <td nowrap
><i>Copyright
© 2000</i></td>
174 <td><i><a href=
"http://www.lsc.nd.edu/~jsiek">Jeremy Siek
</a>, Univ.of
176 "mailto:jsiek@lsc.nd.edu">jsiek@lsc.nd.edu
</a>)
</i></td>
180 <p><i>Distributed under the Boost Software License, Version
1.0. (See
181 accompanying file
<a href=
"../../LICENSE_1_0.txt">LICENSE_1_0.txt
</a> or
183 "http://www.boost.org/LICENSE_1_0.txt">http://www.boost.org/LICENSE_1_0.txt
</a>)
</i></p>