Make it clear that POD's are not zero initialised.

[SVN r29254]
This commit is contained in:
John Maddock 2005-05-28 11:51:04 +00:00
parent 1bd83d43e8
commit 6ea398c446

View File

@ -1,30 +1,19 @@
<html> <html>
<head>
<head> <title>Header </title>
<meta http-equiv="Content-Type" <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
content="text/html; charset=iso-8859-1"> <meta name="Template" content="C:\PROGRAM FILES\MICROSOFT OFFICE\OFFICE\html.dot">
<meta name="Template" <meta name="GENERATOR" content="Microsoft FrontPage Express 2.0">
content="C:\PROGRAM FILES\MICROSOFT OFFICE\OFFICE\html.dot"> <boostcompressed_pair.hpp>
<meta name="GENERATOR" content="Microsoft FrontPage Express 2.0"> </head>
<title>Header </title> <body bgcolor="#ffffff" text="#000000" link="#0000ff" vlink="#800080">
<boost/compressed_pair.hpp> <h2><img src="../../boost.png" width="276" height="86">Header &lt;<a href="../../boost/detail/compressed_pair.hpp">boost/compressed_pair.hpp</a>&gt;</h2>
</head> <p>All of the contents of &lt;boost/compressed_pair.hpp&gt; are defined inside
namespace boost.</p>
<body bgcolor="#FFFFFF" text="#000000" link="#0000FF" <p>The class compressed pair is very similar to std::pair, but if either of the
vlink="#800080"> template arguments are empty classes, then the "empty base-class optimisation"
is applied to compress the size of the pair.</p>
<h2><img src="../../boost.png" width="276" height="86">Header <pre>template &lt;class T1, class T2&gt;
&lt;<a href="../../boost/detail/compressed_pair.hpp">boost/compressed_pair.hpp</a>&gt;</h2>
<p>All of the contents of &lt;boost/compressed_pair.hpp&gt; are
defined inside namespace boost.</p>
<p>The class compressed pair is very similar to std::pair, but if
either of the template arguments are empty classes, then the
&quot;empty base-class optimisation&quot; is applied to compress
the size of the pair.</p>
<pre>template &lt;class T1, class T2&gt;
class compressed_pair class compressed_pair
{ {
public: public:
@ -52,47 +41,35 @@ public:
void swap(compressed_pair&amp; y); void swap(compressed_pair&amp; y);
};</pre> };</pre>
<p>The two members of the pair can be accessed using the member functions first()
<p>The two members of the pair can be accessed using the member and second(). Note that not all member functions can be instantiated for all
functions first() and second(). Note that not all member template parameter types. In particular compressed_pair can be instantiated for
functions can be instantiated for all template parameter types. reference and array types, however in these cases the range of constructors
In particular compressed_pair can be instantiated for reference that can be used are limited. If types T1 and T2 are the same type, then there
and array types, however in these cases the range of constructors is only one version of the single-argument constructor, and this constructor
that can be used are limited. If types T1 and T2 are the same initialises both values in the pair to the passed value.</p>
type, then there is only one version of the single-argument <P>Note that if either member is a POD type, then that member is not
constructor, and this constructor initialises both values in the zero-initialized by the compressed_pair default constructor: it's up to you to
pair to the passed value.</p> supply an initial value for these types if you want them to have a default
value.</P>
<p>Note that compressed_pair can not be instantiated if either of <p>Note that compressed_pair can not be instantiated if either of the template
the template arguments is a union type, unless there is compiler arguments is a union type, unless there is compiler support for
support for boost::is_union, or if boost::is_union is specialised boost::is_union, or if boost::is_union is specialised for the union type.</p>
for the union type.</p> <p>Finally, a word of caution for Visual C++ 6 users: if either argument is an
empty type, then assigning to that member will produce memory corruption,
<p>Finally, a word of caution for Visual C++ 6 users: if either unless the empty type has a "do nothing" assignment operator defined. This is
argument is an empty type, then assigning to that member will due to a bug in the way VC6 generates implicit assignment operators.</p>
produce memory corruption, unless the empty type has a &quot;do <hr>
nothing&quot; assignment operator defined. This is due to a bug <p>Revised 08 May 2001</p>
in the way VC6 generates implicit assignment operators.</p> <p>© Copyright boost.org 2000. Permission to copy, use, modify, sell and
distribute this document is granted provided this copyright notice appears in
<hr> all copies. This document is provided "as is" without express or implied
warranty, and with no claim as to its suitability for any purpose.</p>
<p>Revised 08 May 2001</p> <p>Based on contributions by Steve Cleary, Beman Dawes, Howard Hinnant and John
Maddock.</p>
<p>© Copyright boost.org 2000. Permission to copy, use, modify, <p>Maintained by <a href="mailto:john@johnmaddock.co.uk">John Maddock</a>, the
sell and distribute this document is granted provided this latest version of this file can be found at <a href="http://www.boost.org">www.boost.org</a>,
copyright notice appears in all copies. This document is provided and the boost discussion list at <a href="http://www.yahoogroups.com/list/boost">www.yahoogroups.com/list/boost</a>.</p>
&quot;as is&quot; without express or implied warranty, and with <p>&nbsp;</p>
no claim as to its suitability for any purpose.</p> </body>
<p>Based on contributions by Steve Cleary, Beman Dawes, Howard
Hinnant and John Maddock.</p>
<p>Maintained by <a href="mailto:john@johnmaddock.co.uk">John
Maddock</a>, the latest version of this file can be found at <a
href="http://www.boost.org">www.boost.org</a>, and the boost
discussion list at <a
href="http://www.yahoogroups.com/list/boost">www.yahoogroups.com/list/boost</a>.</p>
<p>&nbsp;</p>
</body>
</html> </html>