forked from boostorg/utility
Compare commits
23 Commits
svn-branch
...
boost-1.35
Author | SHA1 | Date | |
---|---|---|---|
|
b9fddc1caa | ||
|
9b52e49fda | ||
|
ab479794f3 | ||
|
97b8966337 | ||
|
88099a882f | ||
|
d5554eb6d7 | ||
|
13bdfb8bbd | ||
|
74462349c2 | ||
|
6aa648d315 | ||
|
9ff18c2c96 | ||
|
d5ea07c737 | ||
|
aa0096bf42 | ||
|
005c2f3cc8 | ||
|
09f7aab52d | ||
|
30a40f9f76 | ||
|
d9f8bae673 | ||
|
3c7b409460 | ||
|
ee3551e8dc | ||
|
95da2e90de | ||
|
6dd93ab916 | ||
|
505d419a1b | ||
|
d968b5f5b9 | ||
|
d809d4e832 |
@@ -740,26 +740,16 @@ specialisation).</p>
|
|||||||
|
|
||||||
<p>Revised 01 September 2000</p>
|
<p>Revised 01 September 2000</p>
|
||||||
|
|
||||||
<p><EFBFBD> Copyright boost.org 2000. Permission to copy, use, modify,
|
<p>
|
||||||
sell and distribute this document is granted provided this
|
Copyright 2000 Steve Cleary, Beman Dawes, Howard
|
||||||
copyright notice appears in all copies. This document is provided
|
Hinnant and John Maddock. <br/>
|
||||||
"as is" without express or implied warranty, and with
|
Use, modification and distribution are subject to the
|
||||||
no claim as to its suitability for any purpose.</p>
|
Boost Software License, Version 1.0.
|
||||||
|
(See accompanying file LICENSE_1_0.txt
|
||||||
<p>Based on contributions by Steve Cleary, Beman Dawes, Howard
|
or copy at <a href="http://www.boost.org/LICENSE_1_0.txt">
|
||||||
Hinnant and John Maddock.</p>
|
http://www.boost.org/LICENSE_1_0.txt
|
||||||
|
</a>).
|
||||||
<p>Maintained by <a href="mailto:john@johnmaddock.co.uk">John
|
</p>
|
||||||
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>.</p>
|
|
||||||
|
|
||||||
<p> </p>
|
|
||||||
|
|
||||||
<p> </p>
|
|
||||||
</body>
|
</body>
|
||||||
</html>
|
</html>
|
||||||
|
|
||||||
|
@@ -366,17 +366,18 @@ David Vandevoorde and Nicolai M. Josuttis.
|
|||||||
<EM>C++ Templates: The Complete Guide</EM>.
|
<EM>C++ Templates: The Complete Guide</EM>.
|
||||||
Addison-Wesley, 2002.</DL>
|
Addison-Wesley, 2002.</DL>
|
||||||
|
|
||||||
|
<hr/>
|
||||||
|
<p>Copyright Jaakko Järvi, Jeremiah Willcock and Andrew Lumsdaine<BR>
|
||||||
|
|
||||||
|
|
||||||
<hr></hr>
|
|
||||||
|
|
||||||
<B>Contributed by:</B> <BR>
|
|
||||||
Jaakko Järvi, Jeremiah Willcock and Andrew Lumsdaine<BR>
|
|
||||||
<EM>{jajarvi|jewillco|lums}@osl.iu.edu</EM><BR>
|
<EM>{jajarvi|jewillco|lums}@osl.iu.edu</EM><BR>
|
||||||
Indiana University<BR>
|
Indiana University<BR>
|
||||||
Open Systems Lab
|
Open Systems Lab<br/>
|
||||||
|
Use, modification and distribution are subject to the
|
||||||
|
Boost Software License, Version 1.0.
|
||||||
|
(See accompanying file LICENSE_1_0.txt
|
||||||
|
or copy at <a href="http://www.boost.org/LICENSE_1_0.txt">
|
||||||
|
http://www.boost.org/LICENSE_1_0.txt
|
||||||
|
</a>).
|
||||||
|
</p>
|
||||||
<!--HTMLFOOT-->
|
<!--HTMLFOOT-->
|
||||||
<!--ENDHTML-->
|
<!--ENDHTML-->
|
||||||
<!--FOOTER-->
|
<!--FOOTER-->
|
||||||
|
@@ -10,10 +10,9 @@
|
|||||||
#define BOOST_RESULT_OF_HPP
|
#define BOOST_RESULT_OF_HPP
|
||||||
|
|
||||||
#include <boost/config.hpp>
|
#include <boost/config.hpp>
|
||||||
#include <boost/preprocessor/iteration/iterate.hpp>
|
#include <boost/type_traits/ice.hpp>
|
||||||
#include <boost/preprocessor/punctuation/comma_if.hpp>
|
#include <boost/type.hpp>
|
||||||
#include <boost/preprocessor/repetition/enum_params.hpp>
|
#include <boost/preprocessor.hpp>
|
||||||
#include <boost/preprocessor/repetition/enum_shifted_params.hpp>
|
|
||||||
#include <boost/detail/workaround.hpp>
|
#include <boost/detail/workaround.hpp>
|
||||||
#include <boost/mpl/has_xxx.hpp>
|
#include <boost/mpl/has_xxx.hpp>
|
||||||
#include <boost/mpl/if.hpp>
|
#include <boost/mpl/if.hpp>
|
||||||
|
@@ -1,20 +1,31 @@
|
|||||||
// (C) Copyright 2002-2008, Fernando Luis Cacciola Carballal.
|
// (C) Copyright 2002-2007, Fernando Luis Cacciola Carballal.
|
||||||
//
|
//
|
||||||
// Distributed under the Boost Software License, Version 1.0. (See
|
// Distributed under the Boost Software License, Version 1.0. (See
|
||||||
// accompanying file LICENSE_1_0.txt or copy at
|
// accompanying file LICENSE_1_0.txt or copy at
|
||||||
// http://www.boost.org/LICENSE_1_0.txt)
|
// http://www.boost.org/LICENSE_1_0.txt)
|
||||||
//
|
//
|
||||||
// 21 Ago 2002 (Created) Fernando Cacciola
|
// 21 Ago 2002 (Created) Fernando Cacciola
|
||||||
// 30 Jan 2008 (Worked around compiler bugs, added initialized_value) Fernando Cacciola, Niels Dekker
|
// 24 Dec 2007 (Refactored and worked around various compiler bugs) Fernando Cacciola, Niels Dekker
|
||||||
//
|
//
|
||||||
#ifndef BOOST_UTILITY_VALUE_INIT_21AGO2002_HPP
|
#ifndef BOOST_UTILITY_VALUE_INIT_21AGO2002_HPP
|
||||||
#define BOOST_UTILITY_VALUE_INIT_21AGO2002_HPP
|
#define BOOST_UTILITY_VALUE_INIT_21AGO2002_HPP
|
||||||
|
|
||||||
// Note: The implementation of boost::value_initialized had to deal with the
|
// Note: The implementation of boost::value_initialized had to deal with the
|
||||||
// fact that various compilers haven't fully implemented value-initialization.
|
// fact that various compilers haven't fully implemented value-initialization:
|
||||||
// The constructor of boost::value_initialized<T> works around these compiler
|
// Microsoft Feedback ID 100744 - Value-initialization in new-expression
|
||||||
// issues, by clearing the bytes of T, before constructing the T object it
|
// Reported by Pavel Kuznetsov (MetaCommunications Engineering), 2005-07-28
|
||||||
// contains. More details on these issues are at libs/utility/value_init.htm
|
// https://connect.microsoft.com/VisualStudio/feedback/ViewFeedback.aspx?FeedbackID=100744
|
||||||
|
// GCC Bug 30111 - Value-initialization of POD base class doesn't initialize members
|
||||||
|
// Reported by Jonathan Wakely, 2006-12-07
|
||||||
|
// http://gcc.gnu.org/bugzilla/show_bug.cgi?id=30111
|
||||||
|
// GCC Bug 33916 - Default constructor fails to initialize array members
|
||||||
|
// Reported by Michael Elizabeth Chastain, 2007-10-26
|
||||||
|
// http://gcc.gnu.org/bugzilla/show_bug.cgi?id=33916
|
||||||
|
// Borland Report 51854 - Value-initialization: POD struct should be zero-initialized
|
||||||
|
// Reported by Niels Dekker (LKEB, Leiden University Medical Center), 2007-11-09
|
||||||
|
// http://qc.codegear.com/wc/qcmain.aspx?d=51854
|
||||||
|
// The constructor of boost::value_initialized<T> works around these issues, by
|
||||||
|
// clearing the bytes of T, before constructing the T object it contains.
|
||||||
|
|
||||||
#include <boost/aligned_storage.hpp>
|
#include <boost/aligned_storage.hpp>
|
||||||
#include <boost/detail/workaround.hpp>
|
#include <boost/detail/workaround.hpp>
|
||||||
@@ -37,32 +48,23 @@ class value_initialized
|
|||||||
remove_const<T>::type data;
|
remove_const<T>::type data;
|
||||||
};
|
};
|
||||||
|
|
||||||
mutable
|
mutable aligned_storage<sizeof(wrapper), alignment_of<wrapper>::value> x;
|
||||||
#if !BOOST_WORKAROUND(__BORLANDC__, BOOST_TESTED_AT(0x592))
|
|
||||||
typename
|
|
||||||
#endif
|
|
||||||
aligned_storage<sizeof(wrapper), alignment_of<wrapper>::value>::type x;
|
|
||||||
|
|
||||||
wrapper * wrapper_address() const
|
|
||||||
{
|
|
||||||
return static_cast<wrapper *>( static_cast<void*>(&x));
|
|
||||||
}
|
|
||||||
|
|
||||||
public :
|
public :
|
||||||
|
|
||||||
value_initialized()
|
value_initialized()
|
||||||
{
|
{
|
||||||
std::memset(&x, 0, sizeof(x));
|
std::memset(x.address(), 0, sizeof(x));
|
||||||
#ifdef BOOST_MSVC
|
#ifdef BOOST_MSVC
|
||||||
#pragma warning(push)
|
#pragma warning(push)
|
||||||
#if _MSC_VER >= 1310
|
#if _MSC_VER >= 1310
|
||||||
// When using MSVC 7.1 or higher, the following placement new expression may trigger warning C4345:
|
// When using MSVC 7.1 or higher, the following placement new expression may trigger warning C4345:
|
||||||
// "behavior change: an object of POD type constructed with an initializer of the form ()
|
// "behavior change: an object of POD type constructed with an initializer of the form ()
|
||||||
// will be default-initialized". It is safe to ignore this warning when using value_initialized.
|
// will be default-initialized". There is no need to worry about this, though.
|
||||||
#pragma warning(disable: 4345)
|
#pragma warning(disable: 4345)
|
||||||
#endif
|
#endif
|
||||||
#endif
|
#endif
|
||||||
new (wrapper_address()) wrapper();
|
new (x.address()) wrapper();
|
||||||
#ifdef BOOST_MSVC
|
#ifdef BOOST_MSVC
|
||||||
#pragma warning(pop)
|
#pragma warning(pop)
|
||||||
#endif
|
#endif
|
||||||
@@ -70,23 +72,25 @@ class value_initialized
|
|||||||
|
|
||||||
value_initialized(value_initialized const & arg)
|
value_initialized(value_initialized const & arg)
|
||||||
{
|
{
|
||||||
new (wrapper_address()) wrapper( static_cast<wrapper const &>(*(arg.wrapper_address())));
|
new (x.address()) wrapper( *static_cast<wrapper const *>(arg.x.address()) );
|
||||||
}
|
}
|
||||||
|
|
||||||
value_initialized & operator=(value_initialized const & arg)
|
value_initialized & operator=(value_initialized const & arg)
|
||||||
{
|
{
|
||||||
this->data() = static_cast<T const &>( arg.data() );
|
T & this_data = this->data();
|
||||||
|
T const & arg_data = arg.data();
|
||||||
|
this_data = arg_data;
|
||||||
return *this;
|
return *this;
|
||||||
}
|
}
|
||||||
|
|
||||||
~value_initialized()
|
~value_initialized()
|
||||||
{
|
{
|
||||||
wrapper_address()->wrapper::~wrapper();
|
static_cast<wrapper *>(x.address())->wrapper::~wrapper();
|
||||||
}
|
}
|
||||||
|
|
||||||
T& data() const
|
T& data() const
|
||||||
{
|
{
|
||||||
return wrapper_address()->data;
|
return static_cast<wrapper *>(x.address())->data;
|
||||||
}
|
}
|
||||||
|
|
||||||
operator T&() const { return this->data(); }
|
operator T&() const { return this->data(); }
|
||||||
@@ -106,18 +110,6 @@ T& get ( value_initialized<T>& x )
|
|||||||
return x.data() ;
|
return x.data() ;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
class initialized_value
|
|
||||||
{
|
|
||||||
public :
|
|
||||||
|
|
||||||
template <class T> operator T() const
|
|
||||||
{
|
|
||||||
return get( value_initialized<T>() );
|
|
||||||
}
|
|
||||||
};
|
|
||||||
|
|
||||||
|
|
||||||
} // namespace boost
|
} // namespace boost
|
||||||
|
|
||||||
|
|
||||||
|
@@ -22,13 +22,14 @@
|
|||||||
<a href="current_function.html">current_function</a><br>
|
<a href="current_function.html">current_function</a><br>
|
||||||
<a href="enable_if.html">enable_if</a><br>
|
<a href="enable_if.html">enable_if</a><br>
|
||||||
<a href="iterator_adaptors.htm">iterator_adaptors</a><br>
|
<a href="iterator_adaptors.htm">iterator_adaptors</a><br>
|
||||||
|
<a href="generator_iterator.htm">generator iterator adaptors</a><br>
|
||||||
<a href="operators.htm">operators</a><br>
|
<a href="operators.htm">operators</a><br>
|
||||||
<a href="throw_exception.html">throw_exception</a><br>
|
<a href="throw_exception.html">throw_exception</a><br>
|
||||||
<a href="utility.htm">utility</a><br>
|
<a href="utility.htm">utility</a><br>
|
||||||
<a href="value_init.htm">value_init</a></p>
|
<a href="value_init.htm">value_init</a></p>
|
||||||
</blockquote>
|
</blockquote>
|
||||||
<hr>
|
<hr>
|
||||||
<p><EFBFBD> Copyright Beman Dawes, 2001</p>
|
<p>© Copyright Beman Dawes, 2001</p>
|
||||||
<p>Distributed under the Boost Software License, Version 1.0. (See
|
<p>Distributed under the Boost Software License, Version 1.0. (See
|
||||||
accompanying file <a href="../../LICENSE_1_0.txt">
|
accompanying file <a href="../../LICENSE_1_0.txt">
|
||||||
LICENSE_1_0.txt</a> or copy at
|
LICENSE_1_0.txt</a> or copy at
|
||||||
|
@@ -315,7 +315,7 @@ Last modified: Mon Aug 11 11:27:03 EST 2003
|
|||||||
<p><EFBFBD> Copyright 2003 The Trustees of Indiana University.
|
<p><EFBFBD> Copyright 2003 The Trustees of Indiana University.
|
||||||
Use, modification and distribution is subject to the Boost Software
|
Use, modification and distribution is subject to the Boost Software
|
||||||
License, Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at
|
License, Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at
|
||||||
http://www.boost.org/LICENSE_1_0.txt)</p>
|
http:www.boost.org/LICENSE_1_0.txt)</p>
|
||||||
|
|
||||||
</body>
|
</body>
|
||||||
|
|
||||||
|
0
test/next_prior_test.cpp
Executable file → Normal file
0
test/next_prior_test.cpp
Executable file → Normal file
@@ -32,8 +32,7 @@
|
|||||||
</dl>
|
</dl>
|
||||||
|
|
||||||
<ul>
|
<ul>
|
||||||
<li><a href="#val_init"><code>template class value_initialized<T></code></a></li>
|
<li><a href="#val_init"><code>value_initialized<T></code></a></li>
|
||||||
<li><a href="#initialized_value"><code>class initialized_value</code></a></li>
|
|
||||||
|
|
||||||
</ul>
|
</ul>
|
||||||
<a href="#acknowledgements">Acknowledgements</a><br>
|
<a href="#acknowledgements">Acknowledgements</a><br>
|
||||||
@@ -53,9 +52,6 @@ union and class types.
|
|||||||
Moreover, <code>value_initialized</code> offers a workaround to various
|
Moreover, <code>value_initialized</code> offers a workaround to various
|
||||||
compiler issues regarding value-initialization.
|
compiler issues regarding value-initialization.
|
||||||
|
|
||||||
Furthermore a convenience class, <code>initialized_value</code> is provided,
|
|
||||||
to avoid repeating the type name when retrieving the value from a
|
|
||||||
<code>value_initialized<T></code> object.
|
|
||||||
<br>
|
<br>
|
||||||
</p>
|
</p>
|
||||||
|
|
||||||
@@ -121,16 +117,6 @@ constructed by the following declaration:
|
|||||||
<pre>
|
<pre>
|
||||||
value_initialized<T> var;
|
value_initialized<T> var;
|
||||||
</pre>
|
</pre>
|
||||||
</p>
|
|
||||||
<p>
|
|
||||||
The convenience class <a href="#initialized_value"><code>initialized_value</code></a>
|
|
||||||
allows value-initializing a variable as follows:
|
|
||||||
<pre>
|
|
||||||
T var = initialized_value();
|
|
||||||
</pre>
|
|
||||||
This form of initialization is also very similar to <code>T4 var4 = T4()</code>,
|
|
||||||
but robust against the aforementioned compiler issues.
|
|
||||||
|
|
||||||
</p>
|
</p>
|
||||||
|
|
||||||
<h2><a name="details"></a>Details</h2>
|
<h2><a name="details"></a>Details</h2>
|
||||||
@@ -312,40 +298,6 @@ the wrapped object is always performed with the <code>get()</code> idiom:</p>
|
|||||||
|
|
||||||
<pre>value_initialized<int> x ;<br>get(x) = 1 ; // OK<br><br>value_initialized<int const> cx ;<br>get(x) = 1 ; // ERROR: Cannot modify a const object<br><br>value_initialized<int> const x_c ;<br>get(x_c) = 1 ; // ERROR: Cannot modify a const object<br><br>value_initialized<int const> const cx_c ;<br>get(cx_c) = 1 ; // ERROR: Cannot modify a const object<br></pre>
|
<pre>value_initialized<int> x ;<br>get(x) = 1 ; // OK<br><br>value_initialized<int const> cx ;<br>get(x) = 1 ; // ERROR: Cannot modify a const object<br><br>value_initialized<int> const x_c ;<br>get(x_c) = 1 ; // ERROR: Cannot modify a const object<br><br>value_initialized<int const> const cx_c ;<br>get(cx_c) = 1 ; // ERROR: Cannot modify a const object<br></pre>
|
||||||
|
|
||||||
<h2><a name="initialized_value"><code>class initialized_value</code></a></h2>
|
|
||||||
|
|
||||||
<pre>
|
|
||||||
namespace boost {
|
|
||||||
class initialized_value
|
|
||||||
{
|
|
||||||
public :
|
|
||||||
template <class T> operator T() const ;
|
|
||||||
};
|
|
||||||
} // namespace boost
|
|
||||||
</pre>
|
|
||||||
|
|
||||||
The class <code>initialized_value</code> provides a convenient way to get
|
|
||||||
an initialized value: its conversion operator provides an appropriate
|
|
||||||
<em>value-initialized</em> object for any CopyConstructible type.
|
|
||||||
|
|
||||||
Suppose you need to have an initialized variable of type <code>T</code>.
|
|
||||||
You could do it as follows:
|
|
||||||
<pre>
|
|
||||||
T var = T();
|
|
||||||
</pre>
|
|
||||||
But as mentioned before, this form suffers from various compiler issues.
|
|
||||||
The template <code>value_initialized</code> offers a workaround:
|
|
||||||
<pre>
|
|
||||||
T var = get( value_initialized<T>() );
|
|
||||||
</pre>
|
|
||||||
Unfortunately both forms repeat the type name, which
|
|
||||||
is rather short now (<code>T</code>), but could of course be
|
|
||||||
more like <code>Namespace::Template<Arg>::Type</code>.
|
|
||||||
Instead, one could use <code>initialized_value</code> as follows:
|
|
||||||
<pre>
|
|
||||||
T var = initialized_value();
|
|
||||||
</pre>
|
|
||||||
|
|
||||||
<h3><a name="references">References</a></h3>
|
<h3><a name="references">References</a></h3>
|
||||||
[1] Bjarne Stroustrup, Gabriel Dos Reis, and J. Stephen Adamczyk wrote
|
[1] Bjarne Stroustrup, Gabriel Dos Reis, and J. Stephen Adamczyk wrote
|
||||||
various papers, proposing to extend the support for brace-enclosed <em>initializer lists</em>
|
various papers, proposing to extend the support for brace-enclosed <em>initializer lists</em>
|
||||||
@@ -374,7 +326,7 @@ for Boost release version 1.35 (2008), offering a workaround to various compiler
|
|||||||
</p>
|
</p>
|
||||||
|
|
||||||
<hr>
|
<hr>
|
||||||
<p>Revised 16 January 2008</p>
|
<p>Revised 15 January 2008</p>
|
||||||
|
|
||||||
<p>© Copyright Fernando Cacciola, 2002, 2008.</p>
|
<p>© Copyright Fernando Cacciola, 2002, 2008.</p>
|
||||||
|
|
||||||
|
@@ -6,8 +6,8 @@
|
|||||||
//
|
//
|
||||||
// Test program for "boost/utility/value_init.hpp"
|
// Test program for "boost/utility/value_init.hpp"
|
||||||
//
|
//
|
||||||
// 21 Ago 2002 (Created) Fernando Cacciola
|
// 21 Agu 2002 (Created) Fernando Cacciola
|
||||||
// 19 Jan 2008 (Added tests regarding compiler issues and initialized_value) Fernando Cacciola, Niels Dekker
|
// 15 Jan 2008 (Added tests regarding compiler issues) Fernando Cacciola, Niels Dekker
|
||||||
|
|
||||||
#include <cstring> // For memcmp.
|
#include <cstring> // For memcmp.
|
||||||
#include <iostream>
|
#include <iostream>
|
||||||
@@ -52,7 +52,7 @@ struct NonPODBase
|
|||||||
struct NonPOD : NonPODBase
|
struct NonPOD : NonPODBase
|
||||||
{
|
{
|
||||||
NonPOD () : id() {}
|
NonPOD () : id() {}
|
||||||
explicit NonPOD ( std::string const& id_) : id(id_) {}
|
NonPOD ( std::string const& id_) : id(id_) {}
|
||||||
|
|
||||||
friend std::ostream& operator << ( std::ostream& os, NonPOD const& npod )
|
friend std::ostream& operator << ( std::ostream& os, NonPOD const& npod )
|
||||||
{ return os << '(' << npod.id << ')' ; }
|
{ return os << '(' << npod.id << ')' ; }
|
||||||
@@ -180,32 +180,6 @@ struct CopyFunctionCallTester
|
|||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
template<class T>
|
|
||||||
void check_initialized_value ( T const& y )
|
|
||||||
{
|
|
||||||
T initializedValue = boost::initialized_value() ;
|
|
||||||
BOOST_CHECK ( y == initializedValue ) ;
|
|
||||||
}
|
|
||||||
|
|
||||||
#ifdef __BORLANDC__
|
|
||||||
#if __BORLANDC__ == 0x582
|
|
||||||
void check_initialized_value( NonPOD const& )
|
|
||||||
{
|
|
||||||
// The initialized_value check is skipped for Borland 5.82
|
|
||||||
// and this type (NonPOD), because the following statement
|
|
||||||
// won't compile on this particular compiler version:
|
|
||||||
// NonPOD initializedValue = boost::initialized_value() ;
|
|
||||||
//
|
|
||||||
// This is caused by a compiler bug, that is fixed with a newer version
|
|
||||||
// of the Borland compiler. The Release Notes for Delphi(R) 2007 for
|
|
||||||
// Win32(R) and C++Builder(R) 2007 (http://dn.codegear.com/article/36575)
|
|
||||||
// say about similar statements:
|
|
||||||
// both of these statements now compile but under 5.82 got the error:
|
|
||||||
// Error E2015: Ambiguity between 'V::V(const A &)' and 'V::V(const V &)'
|
|
||||||
}
|
|
||||||
#endif
|
|
||||||
#endif
|
|
||||||
|
|
||||||
//
|
//
|
||||||
// This test function tests boost::value_initialized<T> for a specific type T.
|
// This test function tests boost::value_initialized<T> for a specific type T.
|
||||||
// The first argument (y) is assumed have the value of a value-initialized object.
|
// The first argument (y) is assumed have the value of a value-initialized object.
|
||||||
@@ -215,13 +189,9 @@ template<class T>
|
|||||||
bool test ( T const& y, T const& z )
|
bool test ( T const& y, T const& z )
|
||||||
{
|
{
|
||||||
const boost::unit_test::counter_t counter_before_test = boost::minimal_test::errors_counter();
|
const boost::unit_test::counter_t counter_before_test = boost::minimal_test::errors_counter();
|
||||||
|
|
||||||
check_initialized_value(y);
|
|
||||||
|
|
||||||
boost::value_initialized<T> x ;
|
boost::value_initialized<T> x ;
|
||||||
BOOST_CHECK ( y == x ) ;
|
BOOST_CHECK ( y == x ) ;
|
||||||
BOOST_CHECK ( y == boost::get(x) ) ;
|
BOOST_CHECK ( y == boost::get(x) ) ;
|
||||||
|
|
||||||
static_cast<T&>(x) = z ;
|
static_cast<T&>(x) = z ;
|
||||||
boost::get(x) = z ;
|
boost::get(x) = z ;
|
||||||
BOOST_CHECK ( x == z ) ;
|
BOOST_CHECK ( x == z ) ;
|
||||||
|
Reference in New Issue
Block a user