Compare commits

..

10 Commits

Author SHA1 Message Date
Daniel James
e2308ce3c9 More fixed links.
[SVN r43279]
2008-02-16 11:39:55 +00:00
Daniel James
c733d07560 Change people links to link to the site.
[SVN r43168]
2008-02-07 22:27:50 +00:00
Daniel James
d497ff80e7 Roll back links to the beta site.
[SVN r43163]
2008-02-07 20:47:08 +00:00
Daniel James
bb3fffd929 Merge.
[SVN r43063]
2008-02-03 10:35:18 +00:00
Daniel James
928091779d Merge.
[SVN r42905]
2008-01-21 20:15:02 +00:00
Daniel James
fc960ec5ef Merge.
[SVN r42338]
2007-12-29 15:30:07 +00:00
Daniel James
e76c779b8c Merge from trunk.
[SVN r42243]
2007-12-22 15:36:31 +00:00
Daniel James
1a4aa43cad Merge from trunk, finally.
[SVN r41817]
2007-12-07 01:12:02 +00:00
Daniel James
9ece1d1d4c Update/fix a load of links, add a missing jamfile.
[SVN r41777]
2007-12-06 07:47:43 +00:00
Daniel James
12de918a3a Create a branch to fix links on.
[SVN r41573]
2007-12-02 10:07:42 +00:00
19 changed files with 241 additions and 299 deletions

View File

@@ -740,16 +740,26 @@ specialisation).</p>
<p>Revised 01 September 2000</p> <p>Revised 01 September 2000</p>
<p> <p><EFBFBD> Copyright boost.org 2000. Permission to copy, use, modify,
Copyright 2000 Steve Cleary, Beman Dawes, Howard sell and distribute this document is granted provided this
Hinnant and John Maddock. <br/> copyright notice appears in all copies. This document is provided
Use, modification and distribution are subject to the &quot;as is&quot; without express or implied warranty, and with
Boost Software License, Version 1.0. no claim as to its suitability for any purpose.</p>
(See accompanying file LICENSE_1_0.txt
or copy at <a href="http://www.boost.org/LICENSE_1_0.txt"> <p>Based on contributions by Steve Cleary, Beman Dawes, Howard
http://www.boost.org/LICENSE_1_0.txt Hinnant and John Maddock.</p>
</a>).
</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>.</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
</body> </body>
</html> </html>

View File

@@ -366,18 +366,17 @@ David Vandevoorde and Nicolai&nbsp;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&auml;rvi, Jeremiah Willcock and Andrew Lumsdaine<BR>
<hr></hr>
<B>Contributed by:</B> <BR>
Jaakko J&auml;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<br/> Open Systems Lab
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-->

View File

@@ -1,6 +1,6 @@
// Boost enable_if library // Boost enable_if library
// Copyright 2003 (c) The Trustees of Indiana University. // Copyright 2003 <EFBFBD> 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

View File

@@ -1,6 +1,6 @@
// Boost enable_if library // Boost enable_if library
// Copyright 2003 (c) The Trustees of Indiana University. // Copyright 2003 <EFBFBD> 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

View File

@@ -1,6 +1,6 @@
// Boost enable_if library // Boost enable_if library
// Copyright 2003 (c) The Trustees of Indiana University. // Copyright 2003 <EFBFBD> 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

View File

@@ -1,6 +1,6 @@
// Boost enable_if library // Boost enable_if library
// Copyright 2003 (c) The Trustees of Indiana University. // Copyright 2003 <EFBFBD> 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

View File

@@ -1,6 +1,6 @@
// Boost enable_if library // Boost enable_if library
// Copyright 2003 (c) The Trustees of Indiana University. // Copyright 2003 <EFBFBD> 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

View File

@@ -1,6 +1,6 @@
// Boost enable_if library // Boost enable_if library
// Copyright 2003 (c) The Trustees of Indiana University. // Copyright 2003 <EFBFBD> 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

View File

@@ -1,6 +1,6 @@
// Boost enable_if library // Boost enable_if library
// Copyright 2003 (c) The Trustees of Indiana University. // Copyright 2003 <EFBFBD> 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

View File

@@ -1,6 +1,6 @@
// Boost enable_if library // Boost enable_if library
// Copyright 2003 (c) The Trustees of Indiana University. // Copyright 2003 <EFBFBD> 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

View File

@@ -1,13 +0,0 @@
//Copyright (c) 2006-2008 Emil Dotchevski and Reverge Studios, Inc.
//Distributed under the Boost Software License, Version 1.0. (See accompanying
//file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
#ifndef UUID_1D94A7C6054E11DB9804B622A1EF5492
#define UUID_1D94A7C6054E11DB9804B622A1EF5492
#include <boost/exception/info_tuple.hpp>
#include <boost/exception/cloning.hpp>
#include <boost/throw_exception.hpp>
#endif

View File

@@ -8,8 +8,6 @@
// See http://www.boost.org/libs/utility/operators.htm for documentation. // See http://www.boost.org/libs/utility/operators.htm for documentation.
// Revision History // Revision History
// 03 Apr 08 Make sure "convertible to bool" is sufficient
// for T::operator<, etc. (Daniel Frey)
// 24 May 07 Changed empty_base to depend on T, see // 24 May 07 Changed empty_base to depend on T, see
// http://svn.boost.org/trac/boost/ticket/979 // http://svn.boost.org/trac/boost/ticket/979
// 21 Oct 02 Modified implementation of operators to allow compilers with a // 21 Oct 02 Modified implementation of operators to allow compilers with a
@@ -126,34 +124,34 @@ namespace boost
template <class T, class U, class B = ::boost::detail::empty_base<T> > template <class T, class U, class B = ::boost::detail::empty_base<T> >
struct less_than_comparable2 : B struct less_than_comparable2 : B
{ {
friend bool operator<=(const T& x, const U& y) { return !static_cast<bool>(x > y); } friend bool operator<=(const T& x, const U& y) { return !(x > y); }
friend bool operator>=(const T& x, const U& y) { return !static_cast<bool>(x < y); } friend bool operator>=(const T& x, const U& y) { return !(x < y); }
friend bool operator>(const U& x, const T& y) { return y < x; } friend bool operator>(const U& x, const T& y) { return y < x; }
friend bool operator<(const U& x, const T& y) { return y > x; } friend bool operator<(const U& x, const T& y) { return y > x; }
friend bool operator<=(const U& x, const T& y) { return !static_cast<bool>(y < x); } friend bool operator<=(const U& x, const T& y) { return !(y < x); }
friend bool operator>=(const U& x, const T& y) { return !static_cast<bool>(y > x); } friend bool operator>=(const U& x, const T& y) { return !(y > x); }
}; };
template <class T, class B = ::boost::detail::empty_base<T> > template <class T, class B = ::boost::detail::empty_base<T> >
struct less_than_comparable1 : B struct less_than_comparable1 : B
{ {
friend bool operator>(const T& x, const T& y) { return y < x; } friend bool operator>(const T& x, const T& y) { return y < x; }
friend bool operator<=(const T& x, const T& y) { return !static_cast<bool>(y < x); } friend bool operator<=(const T& x, const T& y) { return !(y < x); }
friend bool operator>=(const T& x, const T& y) { return !static_cast<bool>(x < y); } friend bool operator>=(const T& x, const T& y) { return !(x < y); }
}; };
template <class T, class U, class B = ::boost::detail::empty_base<T> > template <class T, class U, class B = ::boost::detail::empty_base<T> >
struct equality_comparable2 : B struct equality_comparable2 : B
{ {
friend bool operator==(const U& y, const T& x) { return x == y; } friend bool operator==(const U& y, const T& x) { return x == y; }
friend bool operator!=(const U& y, const T& x) { return !static_cast<bool>(x == y); } friend bool operator!=(const U& y, const T& x) { return !(x == y); }
friend bool operator!=(const T& y, const U& x) { return !static_cast<bool>(y == x); } friend bool operator!=(const T& y, const U& x) { return !(y == x); }
}; };
template <class T, class B = ::boost::detail::empty_base<T> > template <class T, class B = ::boost::detail::empty_base<T> >
struct equality_comparable1 : B struct equality_comparable1 : B
{ {
friend bool operator!=(const T& x, const T& y) { return !static_cast<bool>(x == y); } friend bool operator!=(const T& x, const T& y) { return !(x == y); }
}; };
// A macro which produces "name_2left" from "name". // A macro which produces "name_2left" from "name".
@@ -358,7 +356,7 @@ struct equivalent2 : B
{ {
friend bool operator==(const T& x, const U& y) friend bool operator==(const T& x, const U& y)
{ {
return !static_cast<bool>(x < y) && !static_cast<bool>(x > y); return !(x < y) && !(x > y);
} }
}; };
@@ -367,7 +365,7 @@ struct equivalent1 : B
{ {
friend bool operator==(const T&x, const T&y) friend bool operator==(const T&x, const T&y)
{ {
return !static_cast<bool>(x < y) && !static_cast<bool>(y < x); return !(x < y) && !(y < x);
} }
}; };
@@ -375,17 +373,17 @@ template <class T, class U, class B = ::boost::detail::empty_base<T> >
struct partially_ordered2 : B struct partially_ordered2 : B
{ {
friend bool operator<=(const T& x, const U& y) friend bool operator<=(const T& x, const U& y)
{ return static_cast<bool>(x < y) || static_cast<bool>(x == y); } { return (x < y) || (x == y); }
friend bool operator>=(const T& x, const U& y) friend bool operator>=(const T& x, const U& y)
{ return static_cast<bool>(x > y) || static_cast<bool>(x == y); } { return (x > y) || (x == y); }
friend bool operator>(const U& x, const T& y) friend bool operator>(const U& x, const T& y)
{ return y < x; } { return y < x; }
friend bool operator<(const U& x, const T& y) friend bool operator<(const U& x, const T& y)
{ return y > x; } { return y > x; }
friend bool operator<=(const U& x, const T& y) friend bool operator<=(const U& x, const T& y)
{ return static_cast<bool>(y > x) || static_cast<bool>(y == x); } { return (y > x) || (y == x); }
friend bool operator>=(const U& x, const T& y) friend bool operator>=(const U& x, const T& y)
{ return static_cast<bool>(y < x) || static_cast<bool>(y == x); } { return (y < x) || (y == x); }
}; };
template <class T, class B = ::boost::detail::empty_base<T> > template <class T, class B = ::boost::detail::empty_base<T> >
@@ -394,9 +392,9 @@ struct partially_ordered1 : B
friend bool operator>(const T& x, const T& y) friend bool operator>(const T& x, const T& y)
{ return y < x; } { return y < x; }
friend bool operator<=(const T& x, const T& y) friend bool operator<=(const T& x, const T& y)
{ return static_cast<bool>(x < y) || static_cast<bool>(x == y); } { return (x < y) || (x == y); }
friend bool operator>=(const T& x, const T& y) friend bool operator>=(const T& x, const T& y)
{ return static_cast<bool>(y < x) || static_cast<bool>(x == y); } { return (y < x) || (x == y); }
}; };
// Combined operator classes (contributed by Daryle Walker) ----------------// // Combined operator classes (contributed by Daryle Walker) ----------------//

View File

@@ -1,6 +1,6 @@
// Boost enable_if library // Boost enable_if library
// Copyright 2003 (c) The Trustees of Indiana University. // Copyright 2003 <EFBFBD> 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

View File

@@ -5,7 +5,7 @@
// 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
// 18 Feb 2008 (Worked around compiler bugs, added initialized_value) Fernando Cacciola, Niels Dekker // 30 Jan 2008 (Worked around compiler bugs, added initialized_value) 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
@@ -18,7 +18,6 @@
#include <boost/aligned_storage.hpp> #include <boost/aligned_storage.hpp>
#include <boost/detail/workaround.hpp> #include <boost/detail/workaround.hpp>
#include <boost/static_assert.hpp>
#include <boost/type_traits/cv_traits.hpp> #include <boost/type_traits/cv_traits.hpp>
#include <boost/type_traits/alignment_of.hpp> #include <boost/type_traits/alignment_of.hpp>
#include <cstring> #include <cstring>
@@ -76,9 +75,7 @@ class value_initialized
value_initialized & operator=(value_initialized const & arg) value_initialized & operator=(value_initialized const & arg)
{ {
// Assignment is only allowed when T is non-const. this->data() = static_cast<T const &>( arg.data() );
BOOST_STATIC_ASSERT( ! is_const<T>::value );
*wrapper_address() = static_cast<wrapper const &>(*(arg.wrapper_address()));
return *this; return *this;
} }

View File

@@ -21,15 +21,14 @@
<a href="compressed_pair.htm">compressed_pair</a><br> <a href="compressed_pair.htm">compressed_pair</a><br>
<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>© Copyright Beman Dawes, 2001</p> <p><EFBFBD> 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

View File

@@ -7,7 +7,6 @@
// See http://www.boost.org/libs/utility for documentation. // See http://www.boost.org/libs/utility for documentation.
// Revision History // Revision History
// 03 Apr 08 Added convertible_to_bool (Daniel Frey)
// 01 Oct 01 Added tests for "left" operators // 01 Oct 01 Added tests for "left" operators
// and new grouped operators. (Helmut Zeisel) // and new grouped operators. (Helmut Zeisel)
// 20 May 01 Output progress messages. Added tests for new operator // 20 May 01 Output progress messages. Added tests for new operator
@@ -44,23 +43,6 @@ namespace
unsigned char true_value(unsigned char x) { return x; } unsigned char true_value(unsigned char x) { return x; }
unsigned short true_value(unsigned short x) { return x; } unsigned short true_value(unsigned short x) { return x; }
// verify the minimum requirements for some operators
class convertible_to_bool
{
private:
bool _value;
typedef bool convertible_to_bool::*unspecified_bool_type;
void operator!() const;
public:
convertible_to_bool( const bool value ) : _value( value ) {}
operator unspecified_bool_type() const
{ return _value ? &convertible_to_bool::_value : 0; }
};
// The use of operators<> here tended to obscure // The use of operators<> here tended to obscure
// interactions with certain compiler bugs // interactions with certain compiler bugs
template <class T> template <class T>
@@ -72,10 +54,8 @@ namespace
explicit Wrapped1( T v = T() ) : _value(v) {} explicit Wrapped1( T v = T() ) : _value(v) {}
T value() const { return _value; } T value() const { return _value; }
convertible_to_bool operator<(const Wrapped1& x) const bool operator<(const Wrapped1& x) const { return _value < x._value; }
{ return _value < x._value; } bool operator==(const Wrapped1& x) const { return _value == x._value; }
convertible_to_bool operator==(const Wrapped1& x) const
{ return _value == x._value; }
Wrapped1& operator+=(const Wrapped1& x) Wrapped1& operator+=(const Wrapped1& x)
{ _value += x._value; return *this; } { _value += x._value; return *this; }
@@ -117,10 +97,8 @@ namespace
explicit Wrapped2( T v = T() ) : _value(v) {} explicit Wrapped2( T v = T() ) : _value(v) {}
T value() const { return _value; } T value() const { return _value; }
convertible_to_bool operator<(const Wrapped2& x) const bool operator<(const Wrapped2& x) const { return _value < x._value; }
{ return _value < x._value; } bool operator==(const Wrapped2& x) const { return _value == x._value; }
convertible_to_bool operator==(const Wrapped2& x) const
{ return _value == x._value; }
Wrapped2& operator+=(const Wrapped2& x) Wrapped2& operator+=(const Wrapped2& x)
{ _value += x._value; return *this; } { _value += x._value; return *this; }
@@ -145,13 +123,9 @@ namespace
Wrapped2& operator++() { ++_value; return *this; } Wrapped2& operator++() { ++_value; return *this; }
Wrapped2& operator--() { --_value; return *this; } Wrapped2& operator--() { --_value; return *this; }
convertible_to_bool operator<(U u) const bool operator<(U u) const { return _value < u; }
{ return _value < u; } bool operator>(U u) const { return _value > u; }
convertible_to_bool operator>(U u) const bool operator==(U u) const { return _value == u; }
{ return _value > u; }
convertible_to_bool operator==(U u) const
{ return _value == u; }
Wrapped2& operator+=(U u) { _value += u; return *this; } Wrapped2& operator+=(U u) { _value += u; return *this; }
Wrapped2& operator-=(U u) { _value -= u; return *this; } Wrapped2& operator-=(U u) { _value -= u; return *this; }
Wrapped2& operator*=(U u) { _value *= u; return *this; } Wrapped2& operator*=(U u) { _value *= u; return *this; }
@@ -179,8 +153,7 @@ namespace
explicit Wrapped3( T v = T() ) : _value(v) {} explicit Wrapped3( T v = T() ) : _value(v) {}
T value() const { return _value; } T value() const { return _value; }
convertible_to_bool operator<(const Wrapped3& x) const bool operator<(const Wrapped3& x) const { return _value < x._value; }
{ return _value < x._value; }
private: private:
T _value; T _value;
@@ -201,13 +174,10 @@ namespace
explicit Wrapped4( T v = T() ) : _value(v) {} explicit Wrapped4( T v = T() ) : _value(v) {}
T value() const { return _value; } T value() const { return _value; }
convertible_to_bool operator<(const Wrapped4& x) const bool operator<(const Wrapped4& x) const { return _value < x._value; }
{ return _value < x._value; }
convertible_to_bool operator<(U u) const bool operator<(U u) const { return _value < u; }
{ return _value < u; } bool operator>(U u) const { return _value > u; }
convertible_to_bool operator>(U u) const
{ return _value > u; }
private: private:
T _value; T _value;
@@ -228,18 +198,11 @@ namespace
Wrapped5(U u) : _value(u) {} Wrapped5(U u) : _value(u) {}
T value() const { return _value; } T value() const { return _value; }
bool operator<(const Wrapped5& x) const { return _value < x._value; }
convertible_to_bool operator<(const Wrapped5& x) const bool operator<(U u) const { return _value < u; }
{ return _value < x._value; } bool operator>(U u) const { return _value > u; }
convertible_to_bool operator<(U u) const bool operator==(const Wrapped5& u) const { return _value == u._value; }
{ return _value < u; } bool operator==(U u) const { return _value == u; }
convertible_to_bool operator>(U u) const
{ return _value > u; }
convertible_to_bool operator==(const Wrapped5& u) const
{ return _value == u._value; }
convertible_to_bool operator==(U u) const
{ return _value == u; }
Wrapped5& operator/=(const Wrapped5& u) { _value /= u._value; return *this;} Wrapped5& operator/=(const Wrapped5& u) { _value /= u._value; return *this;}
Wrapped5& operator/=(U u) { _value /= u; return *this;} Wrapped5& operator/=(U u) { _value /= u; return *this;}
Wrapped5& operator*=(const Wrapped5& u) { _value *= u._value; return *this;} Wrapped5& operator*=(const Wrapped5& u) { _value *= u._value; return *this;}
@@ -268,18 +231,11 @@ namespace
Wrapped6(U u) : _value(u) {} Wrapped6(U u) : _value(u) {}
T value() const { return _value; } T value() const { return _value; }
bool operator<(const Wrapped6& x) const { return _value < x._value; }
convertible_to_bool operator<(const Wrapped6& x) const bool operator<(U u) const { return _value < u; }
{ return _value < x._value; } bool operator>(U u) const { return _value > u; }
convertible_to_bool operator<(U u) const bool operator==(const Wrapped6& u) const { return _value == u._value; }
{ return _value < u; } bool operator==(U u) const { return _value == u; }
convertible_to_bool operator>(U u) const
{ return _value > u; }
convertible_to_bool operator==(const Wrapped6& u) const
{ return _value == u._value; }
convertible_to_bool operator==(U u) const
{ return _value == u; }
Wrapped6& operator%=(const Wrapped6& u) { _value %= u._value; return *this;} Wrapped6& operator%=(const Wrapped6& u) { _value %= u._value; return *this;}
Wrapped6& operator%=(U u) { _value %= u; return *this;} Wrapped6& operator%=(U u) { _value %= u; return *this;}
Wrapped6& operator/=(const Wrapped6& u) { _value /= u._value; return *this;} Wrapped6& operator/=(const Wrapped6& u) { _value /= u._value; return *this;}
@@ -320,10 +276,10 @@ namespace
template <class X1, class Y1, class X2, class Y2> template <class X1, class Y1, class X2, class Y2>
void test_less_than_comparable_aux(X1 x1, Y1 y1, X2 x2, Y2 y2) void test_less_than_comparable_aux(X1 x1, Y1 y1, X2 x2, Y2 y2)
{ {
BOOST_CHECK( static_cast<bool>(x1 < y1) == static_cast<bool>(x2 < y2) ); BOOST_CHECK( (x1 < y1) == (x2 < y2) );
BOOST_CHECK( static_cast<bool>(x1 <= y1) == static_cast<bool>(x2 <= y2) ); BOOST_CHECK( (x1 <= y1) == (x2 <= y2) );
BOOST_CHECK( static_cast<bool>(x1 >= y1) == static_cast<bool>(x2 >= y2) ); BOOST_CHECK( (x1 >= y1) == (x2 >= y2) );
BOOST_CHECK( static_cast<bool>(x1 > y1) == static_cast<bool>(x2 > y2) ); BOOST_CHECK( (x1 > y1) == (x2 > y2) );
} }
template <class X1, class Y1, class X2, class Y2> template <class X1, class Y1, class X2, class Y2>
@@ -337,8 +293,8 @@ namespace
template <class X1, class Y1, class X2, class Y2> template <class X1, class Y1, class X2, class Y2>
void test_equality_comparable_aux(X1 x1, Y1 y1, X2 x2, Y2 y2) void test_equality_comparable_aux(X1 x1, Y1 y1, X2 x2, Y2 y2)
{ {
BOOST_CHECK( static_cast<bool>(x1 == y1) == static_cast<bool>(x2 == y2) ); BOOST_CHECK( (x1 == y1) == (x2 == y2) );
BOOST_CHECK( static_cast<bool>(x1 != y1) == static_cast<bool>(x2 != y2) ); BOOST_CHECK( (x1 != y1) == (x2 != y2) );
} }
template <class X1, class Y1, class X2, class Y2> template <class X1, class Y1, class X2, class Y2>
@@ -658,14 +614,14 @@ test_main( int , char * [] )
PRIVATE_EXPR_TEST( (i = i2), (i.value() == 2) ); PRIVATE_EXPR_TEST( (i = i2), (i.value() == 2) );
BOOST_CHECK( static_cast<bool>(i2 == i) ); BOOST_CHECK( i2 == i );
BOOST_CHECK( static_cast<bool>(i1 != i2) ); BOOST_CHECK( i1 != i2 );
BOOST_CHECK( static_cast<bool>(i1 < i2) ); BOOST_CHECK( i1 < i2 );
BOOST_CHECK( static_cast<bool>(i1 <= i2) ); BOOST_CHECK( i1 <= i2 );
BOOST_CHECK( static_cast<bool>(i <= i2) ); BOOST_CHECK( i <= i2 );
BOOST_CHECK( static_cast<bool>(i2 > i1) ); BOOST_CHECK( i2 > i1 );
BOOST_CHECK( static_cast<bool>(i2 >= i1) ); BOOST_CHECK( i2 >= i1 );
BOOST_CHECK( static_cast<bool>(i2 >= i) ); BOOST_CHECK( i2 >= i );
PRIVATE_EXPR_TEST( (i = i1 + i2), (i.value() == 3) ); PRIVATE_EXPR_TEST( (i = i1 + i2), (i.value() == 3) );
PRIVATE_EXPR_TEST( (i = i + i2), (i.value() == 5) ); PRIVATE_EXPR_TEST( (i = i + i2), (i.value() == 5) );
@@ -697,78 +653,78 @@ test_main( int , char * [] )
PRIVATE_EXPR_TEST( (j = j2), (j.value() == 2) ); PRIVATE_EXPR_TEST( (j = j2), (j.value() == 2) );
BOOST_CHECK( static_cast<bool>(j2 == j) ); BOOST_CHECK( j2 == j );
BOOST_CHECK( static_cast<bool>(2 == j) ); BOOST_CHECK( 2 == j );
BOOST_CHECK( static_cast<bool>(j2 == 2) ); BOOST_CHECK( j2 == 2 );
BOOST_CHECK( static_cast<bool>(j == j2) ); BOOST_CHECK( j == j2 );
BOOST_CHECK( static_cast<bool>(j1 != j2) ); BOOST_CHECK( j1 != j2 );
BOOST_CHECK( static_cast<bool>(j1 != 2) ); BOOST_CHECK( j1 != 2 );
BOOST_CHECK( static_cast<bool>(1 != j2) ); BOOST_CHECK( 1 != j2 );
BOOST_CHECK( static_cast<bool>(j1 < j2) ); BOOST_CHECK( j1 < j2 );
BOOST_CHECK( static_cast<bool>(1 < j2) ); BOOST_CHECK( 1 < j2 );
BOOST_CHECK( static_cast<bool>(j1 < 2) ); BOOST_CHECK( j1 < 2 );
BOOST_CHECK( static_cast<bool>(j1 <= j2) ); BOOST_CHECK( j1 <= j2 );
BOOST_CHECK( static_cast<bool>(1 <= j2) ); BOOST_CHECK( 1 <= j2 );
BOOST_CHECK( static_cast<bool>(j1 <= j) ); BOOST_CHECK( j1 <= j );
BOOST_CHECK( static_cast<bool>(j <= j2) ); BOOST_CHECK( j <= j2 );
BOOST_CHECK( static_cast<bool>(2 <= j2) ); BOOST_CHECK( 2 <= j2 );
BOOST_CHECK( static_cast<bool>(j <= 2) ); BOOST_CHECK( j <= 2 );
BOOST_CHECK( static_cast<bool>(j2 > j1) ); BOOST_CHECK( j2 > j1 );
BOOST_CHECK( static_cast<bool>(2 > j1) ); BOOST_CHECK( 2 > j1 );
BOOST_CHECK( static_cast<bool>(j2 > 1) ); BOOST_CHECK( j2 > 1 );
BOOST_CHECK( static_cast<bool>(j2 >= j1) ); BOOST_CHECK( j2 >= j1 );
BOOST_CHECK( static_cast<bool>(2 >= j1) ); BOOST_CHECK( 2 >= j1 );
BOOST_CHECK( static_cast<bool>(j2 >= 1) ); BOOST_CHECK( j2 >= 1 );
BOOST_CHECK( static_cast<bool>(j2 >= j) ); BOOST_CHECK( j2 >= j );
BOOST_CHECK( static_cast<bool>(2 >= j) ); BOOST_CHECK( 2 >= j );
BOOST_CHECK( static_cast<bool>(j2 >= 2) ); BOOST_CHECK( j2 >= 2 );
BOOST_CHECK( static_cast<bool>((j1 + 2) == 3) ); BOOST_CHECK( (j1 + 2) == 3 );
BOOST_CHECK( static_cast<bool>((1 + j2) == 3) ); BOOST_CHECK( (1 + j2) == 3 );
PRIVATE_EXPR_TEST( (j = j1 + j2), (j.value() == 3) ); PRIVATE_EXPR_TEST( (j = j1 + j2), (j.value() == 3) );
BOOST_CHECK( static_cast<bool>((j + 2) == 5) ); BOOST_CHECK( (j + 2) == 5 );
BOOST_CHECK( static_cast<bool>((3 + j2) == 5) ); BOOST_CHECK( (3 + j2) == 5 );
PRIVATE_EXPR_TEST( (j = j + j2), (j.value() == 5) ); PRIVATE_EXPR_TEST( (j = j + j2), (j.value() == 5) );
BOOST_CHECK( static_cast<bool>((j - 1) == 4) ); BOOST_CHECK( (j - 1) == 4 );
PRIVATE_EXPR_TEST( (j = j - j1), (j.value() == 4) ); PRIVATE_EXPR_TEST( (j = j - j1), (j.value() == 4) );
BOOST_CHECK( static_cast<bool>((j * 2) == 8) ); BOOST_CHECK( (j * 2) == 8 );
BOOST_CHECK( static_cast<bool>((4 * j2) == 8) ); BOOST_CHECK( (4 * j2) == 8 );
PRIVATE_EXPR_TEST( (j = j * j2), (j.value() == 8) ); PRIVATE_EXPR_TEST( (j = j * j2), (j.value() == 8) );
BOOST_CHECK( static_cast<bool>((j / 2) == 4) ); BOOST_CHECK( (j / 2) == 4 );
PRIVATE_EXPR_TEST( (j = j / j2), (j.value() == 4) ); PRIVATE_EXPR_TEST( (j = j / j2), (j.value() == 4) );
BOOST_CHECK( static_cast<bool>((j % 3) == 1) ); BOOST_CHECK( (j % 3) == 1 );
PRIVATE_EXPR_TEST( (j = j % ( j - j1 )), (j.value() == 1) ); PRIVATE_EXPR_TEST( (j = j % ( j - j1 )), (j.value() == 1) );
PRIVATE_EXPR_TEST( (j = j2 + j2), (j.value() == 4) ); PRIVATE_EXPR_TEST( (j = j2 + j2), (j.value() == 4) );
BOOST_CHECK( static_cast<bool>((1 | j2 | j) == 7) ); BOOST_CHECK( (1 | j2 | j) == 7 );
BOOST_CHECK( static_cast<bool>((j1 | 2 | j) == 7) ); BOOST_CHECK( (j1 | 2 | j) == 7 );
BOOST_CHECK( static_cast<bool>((j1 | j2 | 4) == 7) ); BOOST_CHECK( (j1 | j2 | 4) == 7 );
PRIVATE_EXPR_TEST( (j = j1 | j2 | j), (j.value() == 7) ); PRIVATE_EXPR_TEST( (j = j1 | j2 | j), (j.value() == 7) );
BOOST_CHECK( static_cast<bool>((7 & j2) == 2) ); BOOST_CHECK( (7 & j2) == 2 );
BOOST_CHECK( static_cast<bool>((j & 2) == 2) ); BOOST_CHECK( (j & 2) == 2 );
PRIVATE_EXPR_TEST( (j = j & j2), (j.value() == 2) ); PRIVATE_EXPR_TEST( (j = j & j2), (j.value() == 2) );
PRIVATE_EXPR_TEST( (j = j | j1), (j.value() == 3) ); PRIVATE_EXPR_TEST( (j = j | j1), (j.value() == 3) );
BOOST_CHECK( static_cast<bool>((3 ^ j1) == 2) ); BOOST_CHECK( (3 ^ j1) == 2 );
BOOST_CHECK( static_cast<bool>((j ^ 1) == 2) ); BOOST_CHECK( (j ^ 1) == 2 );
PRIVATE_EXPR_TEST( (j = j ^ j1), (j.value() == 2) ); PRIVATE_EXPR_TEST( (j = j ^ j1), (j.value() == 2) );
PRIVATE_EXPR_TEST( (j = ( j + j1 ) * ( j2 | j1 )), (j.value() == 9) ); PRIVATE_EXPR_TEST( (j = ( j + j1 ) * ( j2 | j1 )), (j.value() == 9) );
BOOST_CHECK( static_cast<bool>((j1 << 2) == 4) ); BOOST_CHECK( (j1 << 2) == 4 );
BOOST_CHECK( static_cast<bool>((j2 << 1) == 4) ); BOOST_CHECK( (j2 << 1) == 4 );
PRIVATE_EXPR_TEST( (j = j1 << j2), (j.value() == 4) ); PRIVATE_EXPR_TEST( (j = j1 << j2), (j.value() == 4) );
BOOST_CHECK( static_cast<bool>((j >> 2) == 1) ); BOOST_CHECK( (j >> 2) == 1 );
BOOST_CHECK( static_cast<bool>((j2 >> 1) == 1) ); BOOST_CHECK( (j2 >> 1) == 1 );
PRIVATE_EXPR_TEST( (j = j2 >> j1), (j.value() == 1) ); PRIVATE_EXPR_TEST( (j = j2 >> j1), (j.value() == 1) );
cout << "Performed tests on MyLong objects.\n"; cout << "Performed tests on MyLong objects.\n";
@@ -785,14 +741,14 @@ test_main( int , char * [] )
PRIVATE_EXPR_TEST( (k = k2), (k.value() == 2) ); PRIVATE_EXPR_TEST( (k = k2), (k.value() == 2) );
BOOST_CHECK( static_cast<bool>(k2 == k) ); BOOST_CHECK( k2 == k );
BOOST_CHECK( static_cast<bool>(k1 != k2) ); BOOST_CHECK( k1 != k2 );
BOOST_CHECK( static_cast<bool>(k1 < k2) ); BOOST_CHECK( k1 < k2 );
BOOST_CHECK( static_cast<bool>(k1 <= k2) ); BOOST_CHECK( k1 <= k2 );
BOOST_CHECK( static_cast<bool>(k <= k2) ); BOOST_CHECK( k <= k2 );
BOOST_CHECK( static_cast<bool>(k2 > k1) ); BOOST_CHECK( k2 > k1 );
BOOST_CHECK( static_cast<bool>(k2 >= k1) ); BOOST_CHECK( k2 >= k1 );
BOOST_CHECK( static_cast<bool>(k2 >= k) ); BOOST_CHECK( k2 >= k );
cout << "Performed tests on MyChar objects.\n"; cout << "Performed tests on MyChar objects.\n";
@@ -808,31 +764,31 @@ test_main( int , char * [] )
PRIVATE_EXPR_TEST( (l = l2), (l.value() == 2) ); PRIVATE_EXPR_TEST( (l = l2), (l.value() == 2) );
BOOST_CHECK( static_cast<bool>(l2 == l) ); BOOST_CHECK( l2 == l );
BOOST_CHECK( static_cast<bool>(2 == l) ); BOOST_CHECK( 2 == l );
BOOST_CHECK( static_cast<bool>(l2 == 2) ); BOOST_CHECK( l2 == 2 );
BOOST_CHECK( static_cast<bool>(l == l2) ); BOOST_CHECK( l == l2 );
BOOST_CHECK( static_cast<bool>(l1 != l2) ); BOOST_CHECK( l1 != l2 );
BOOST_CHECK( static_cast<bool>(l1 != 2) ); BOOST_CHECK( l1 != 2 );
BOOST_CHECK( static_cast<bool>(1 != l2) ); BOOST_CHECK( 1 != l2 );
BOOST_CHECK( static_cast<bool>(l1 < l2) ); BOOST_CHECK( l1 < l2 );
BOOST_CHECK( static_cast<bool>(1 < l2) ); BOOST_CHECK( 1 < l2 );
BOOST_CHECK( static_cast<bool>(l1 < 2) ); BOOST_CHECK( l1 < 2 );
BOOST_CHECK( static_cast<bool>(l1 <= l2) ); BOOST_CHECK( l1 <= l2 );
BOOST_CHECK( static_cast<bool>(1 <= l2) ); BOOST_CHECK( 1 <= l2 );
BOOST_CHECK( static_cast<bool>(l1 <= l) ); BOOST_CHECK( l1 <= l );
BOOST_CHECK( static_cast<bool>(l <= l2) ); BOOST_CHECK( l <= l2 );
BOOST_CHECK( static_cast<bool>(2 <= l2) ); BOOST_CHECK( 2 <= l2 );
BOOST_CHECK( static_cast<bool>(l <= 2) ); BOOST_CHECK( l <= 2 );
BOOST_CHECK( static_cast<bool>(l2 > l1) ); BOOST_CHECK( l2 > l1 );
BOOST_CHECK( static_cast<bool>(2 > l1) ); BOOST_CHECK( 2 > l1 );
BOOST_CHECK( static_cast<bool>(l2 > 1) ); BOOST_CHECK( l2 > 1 );
BOOST_CHECK( static_cast<bool>(l2 >= l1) ); BOOST_CHECK( l2 >= l1 );
BOOST_CHECK( static_cast<bool>(2 >= l1) ); BOOST_CHECK( 2 >= l1 );
BOOST_CHECK( static_cast<bool>(l2 >= 1) ); BOOST_CHECK( l2 >= 1 );
BOOST_CHECK( static_cast<bool>(l2 >= l) ); BOOST_CHECK( l2 >= l );
BOOST_CHECK( static_cast<bool>(2 >= l) ); BOOST_CHECK( 2 >= l );
BOOST_CHECK( static_cast<bool>(l2 >= 2) ); BOOST_CHECK( l2 >= 2 );
cout << "Performed tests on MyShort objects.\n"; cout << "Performed tests on MyShort objects.\n";
@@ -851,37 +807,37 @@ test_main( int , char * [] )
PRIVATE_EXPR_TEST( (di = di2), (di.value() == 2) ); PRIVATE_EXPR_TEST( (di = di2), (di.value() == 2) );
BOOST_CHECK( static_cast<bool>(di2 == di) ); BOOST_CHECK( di2 == di );
BOOST_CHECK( static_cast<bool>(2 == di) ); BOOST_CHECK( 2 == di );
BOOST_CHECK( static_cast<bool>(di == 2) ); BOOST_CHECK( di == 2 );
BOOST_CHECK( static_cast<bool>(di1 < di2) ); BOOST_CHECK( di1 < di2 );
BOOST_CHECK( static_cast<bool>(1 < di2) ); BOOST_CHECK( 1 < di2 );
BOOST_CHECK( static_cast<bool>(di1 <= di2) ); BOOST_CHECK( di1 <= di2 );
BOOST_CHECK( static_cast<bool>(1 <= di2) ); BOOST_CHECK( 1 <= di2 );
BOOST_CHECK( static_cast<bool>(di2 > di1) ); BOOST_CHECK( di2 > di1 );
BOOST_CHECK( static_cast<bool>(di2 > 1) ); BOOST_CHECK( di2 > 1 );
BOOST_CHECK( static_cast<bool>(di2 >= di1) ); BOOST_CHECK( di2 >= di1 );
BOOST_CHECK( static_cast<bool>(di2 >= 1) ); BOOST_CHECK( di2 >= 1 );
BOOST_CHECK( static_cast<bool>(di1 / di2 == half) ); BOOST_CHECK( di1 / di2 == half );
BOOST_CHECK( static_cast<bool>(di1 / 2 == half) ); BOOST_CHECK( di1 / 2 == half );
BOOST_CHECK( static_cast<bool>(1 / di2 == half) ); BOOST_CHECK( 1 / di2 == half );
PRIVATE_EXPR_TEST( (tmp=di1), static_cast<bool>((tmp/=2) == half) ); PRIVATE_EXPR_TEST( (tmp=di1), ((tmp/=2) == half) );
PRIVATE_EXPR_TEST( (tmp=di1), static_cast<bool>((tmp/=di2) == half) ); PRIVATE_EXPR_TEST( (tmp=di1), ((tmp/=di2) == half) );
BOOST_CHECK( static_cast<bool>(di1 * di2 == di2) ); BOOST_CHECK( di1 * di2 == di2 );
BOOST_CHECK( static_cast<bool>(di1 * 2 == di2) ); BOOST_CHECK( di1 * 2 == di2 );
BOOST_CHECK( static_cast<bool>(1 * di2 == di2) ); BOOST_CHECK( 1 * di2 == di2 );
PRIVATE_EXPR_TEST( (tmp=di1), static_cast<bool>((tmp*=2) == di2) ); PRIVATE_EXPR_TEST( (tmp=di1), ((tmp*=2) == di2) );
PRIVATE_EXPR_TEST( (tmp=di1), static_cast<bool>((tmp*=di2) == di2) ); PRIVATE_EXPR_TEST( (tmp=di1), ((tmp*=di2) == di2) );
BOOST_CHECK( static_cast<bool>(di2 - di1 == di1) ); BOOST_CHECK( di2 - di1 == di1 );
BOOST_CHECK( static_cast<bool>(di2 - 1 == di1) ); BOOST_CHECK( di2 - 1 == di1 );
BOOST_CHECK( static_cast<bool>(2 - di1 == di1) ); BOOST_CHECK( 2 - di1 == di1 );
PRIVATE_EXPR_TEST( (tmp=di2), static_cast<bool>((tmp-=1) == di1) ); PRIVATE_EXPR_TEST( (tmp=di2), ((tmp-=1) == di1) );
PRIVATE_EXPR_TEST( (tmp=di2), static_cast<bool>((tmp-=di1) == di1) ); PRIVATE_EXPR_TEST( (tmp=di2), ((tmp-=di1) == di1) );
BOOST_CHECK( static_cast<bool>(di1 + di1 == di2) ); BOOST_CHECK( di1 + di1 == di2 );
BOOST_CHECK( static_cast<bool>(di1 + 1 == di2) ); BOOST_CHECK( di1 + 1 == di2 );
BOOST_CHECK( static_cast<bool>(1 + di1 == di2) ); BOOST_CHECK( 1 + di1 == di2 );
PRIVATE_EXPR_TEST( (tmp=di1), static_cast<bool>((tmp+=1) == di2) ); PRIVATE_EXPR_TEST( (tmp=di1), ((tmp+=1) == di2) );
PRIVATE_EXPR_TEST( (tmp=di1), static_cast<bool>((tmp+=di1) == di2) ); PRIVATE_EXPR_TEST( (tmp=di1), ((tmp+=di1) == di2) );
cout << "Performed tests on MyDoubleInt objects.\n"; cout << "Performed tests on MyDoubleInt objects.\n";
@@ -898,42 +854,42 @@ test_main( int , char * [] )
PRIVATE_EXPR_TEST( (li = li2), (li.value() == 2) ); PRIVATE_EXPR_TEST( (li = li2), (li.value() == 2) );
BOOST_CHECK( static_cast<bool>(li2 == li) ); BOOST_CHECK( li2 == li );
BOOST_CHECK( static_cast<bool>(2 == li) ); BOOST_CHECK( 2 == li );
BOOST_CHECK( static_cast<bool>(li == 2) ); BOOST_CHECK( li == 2 );
BOOST_CHECK( static_cast<bool>(li1 < li2) ); BOOST_CHECK( li1 < li2 );
BOOST_CHECK( static_cast<bool>(1 < li2) ); BOOST_CHECK( 1 < li2 );
BOOST_CHECK( static_cast<bool>(li1 <= li2) ); BOOST_CHECK( li1 <= li2 );
BOOST_CHECK( static_cast<bool>(1 <= li2) ); BOOST_CHECK( 1 <= li2 );
BOOST_CHECK( static_cast<bool>(li2 > li1) ); BOOST_CHECK( li2 > li1 );
BOOST_CHECK( static_cast<bool>(li2 > 1) ); BOOST_CHECK( li2 > 1 );
BOOST_CHECK( static_cast<bool>(li2 >= li1) ); BOOST_CHECK( li2 >= li1 );
BOOST_CHECK( static_cast<bool>(li2 >= 1) ); BOOST_CHECK( li2 >= 1 );
BOOST_CHECK( static_cast<bool>(li1 % li2 == li1) ); BOOST_CHECK( li1 % li2 == li1 );
BOOST_CHECK( static_cast<bool>(li1 % 2 == li1) ); BOOST_CHECK( li1 % 2 == li1 );
BOOST_CHECK( static_cast<bool>(1 % li2 == li1) ); BOOST_CHECK( 1 % li2 == li1 );
PRIVATE_EXPR_TEST( (tmp2=li1), static_cast<bool>((tmp2%=2) == li1) ); PRIVATE_EXPR_TEST( (tmp2=li1), ((tmp2%=2) == li1) );
PRIVATE_EXPR_TEST( (tmp2=li1), static_cast<bool>((tmp2%=li2) == li1) ); PRIVATE_EXPR_TEST( (tmp2=li1), ((tmp2%=li2) == li1) );
BOOST_CHECK( static_cast<bool>(li1 / li2 == 0) ); BOOST_CHECK( li1 / li2 == 0 );
BOOST_CHECK( static_cast<bool>(li1 / 2 == 0) ); BOOST_CHECK( li1 / 2 == 0 );
BOOST_CHECK( static_cast<bool>(1 / li2 == 0) ); BOOST_CHECK( 1 / li2 == 0 );
PRIVATE_EXPR_TEST( (tmp2=li1), static_cast<bool>((tmp2/=2) == 0) ); PRIVATE_EXPR_TEST( (tmp2=li1), ((tmp2/=2) == 0) );
PRIVATE_EXPR_TEST( (tmp2=li1), static_cast<bool>((tmp2/=li2) == 0) ); PRIVATE_EXPR_TEST( (tmp2=li1), ((tmp2/=li2) == 0) );
BOOST_CHECK( static_cast<bool>(li1 * li2 == li2) ); BOOST_CHECK( li1 * li2 == li2 );
BOOST_CHECK( static_cast<bool>(li1 * 2 == li2) ); BOOST_CHECK( li1 * 2 == li2 );
BOOST_CHECK( static_cast<bool>(1 * li2 == li2) ); BOOST_CHECK( 1 * li2 == li2 );
PRIVATE_EXPR_TEST( (tmp2=li1), static_cast<bool>((tmp2*=2) == li2) ); PRIVATE_EXPR_TEST( (tmp2=li1), ((tmp2*=2) == li2) );
PRIVATE_EXPR_TEST( (tmp2=li1), static_cast<bool>((tmp2*=li2) == li2) ); PRIVATE_EXPR_TEST( (tmp2=li1), ((tmp2*=li2) == li2) );
BOOST_CHECK( static_cast<bool>(li2 - li1 == li1) ); BOOST_CHECK( li2 - li1 == li1 );
BOOST_CHECK( static_cast<bool>(li2 - 1 == li1) ); BOOST_CHECK( li2 - 1 == li1 );
BOOST_CHECK( static_cast<bool>(2 - li1 == li1) ); BOOST_CHECK( 2 - li1 == li1 );
PRIVATE_EXPR_TEST( (tmp2=li2), static_cast<bool>((tmp2-=1) == li1) ); PRIVATE_EXPR_TEST( (tmp2=li2), ((tmp2-=1) == li1) );
PRIVATE_EXPR_TEST( (tmp2=li2), static_cast<bool>((tmp2-=li1) == li1) ); PRIVATE_EXPR_TEST( (tmp2=li2), ((tmp2-=li1) == li1) );
BOOST_CHECK( static_cast<bool>(li1 + li1 == li2) ); BOOST_CHECK( li1 + li1 == li2 );
BOOST_CHECK( static_cast<bool>(li1 + 1 == li2) ); BOOST_CHECK( li1 + 1 == li2 );
BOOST_CHECK( static_cast<bool>(1 + li1 == li2) ); BOOST_CHECK( 1 + li1 == li2 );
PRIVATE_EXPR_TEST( (tmp2=li1), static_cast<bool>((tmp2+=1) == li2) ); PRIVATE_EXPR_TEST( (tmp2=li1), ((tmp2+=1) == li2) );
PRIVATE_EXPR_TEST( (tmp2=li1), static_cast<bool>((tmp2+=li1) == li2) ); PRIVATE_EXPR_TEST( (tmp2=li1), ((tmp2+=li1) == li2) );
cout << "Performed tests on MyLongInt objects.\n"; cout << "Performed tests on MyLongInt objects.\n";

View File

@@ -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 Normal file → Executable file
View File

View File

@@ -7,7 +7,7 @@
// Test program for "boost/utility/value_init.hpp" // Test program for "boost/utility/value_init.hpp"
// //
// 21 Ago 2002 (Created) Fernando Cacciola // 21 Ago 2002 (Created) Fernando Cacciola
// 18 Feb 2008 (Added tests regarding compiler issues and initialized_value) Fernando Cacciola, Niels Dekker // 19 Jan 2008 (Added tests regarding compiler issues and initialized_value) Fernando Cacciola, Niels Dekker
#include <cstring> // For memcmp. #include <cstring> // For memcmp.
#include <iostream> #include <iostream>
@@ -305,10 +305,6 @@ int test_main(int, char **)
boost::value_initialized<ArrayOfBytes> valueInitializedArrayOfBytes; boost::value_initialized<ArrayOfBytes> valueInitializedArrayOfBytes;
BOOST_CHECK (std::memcmp(get(valueInitializedArrayOfBytes), zeroInitializedArrayOfBytes, sizeof(ArrayOfBytes)) == 0); BOOST_CHECK (std::memcmp(get(valueInitializedArrayOfBytes), zeroInitializedArrayOfBytes, sizeof(ArrayOfBytes)) == 0);
boost::value_initialized<ArrayOfBytes> valueInitializedArrayOfBytes2;
valueInitializedArrayOfBytes2 = valueInitializedArrayOfBytes;
BOOST_CHECK (std::memcmp(get(valueInitializedArrayOfBytes), get(valueInitializedArrayOfBytes2), sizeof(ArrayOfBytes)) == 0);
boost::value_initialized<CopyFunctionCallTester> copyFunctionCallTester1; boost::value_initialized<CopyFunctionCallTester> copyFunctionCallTester1;
BOOST_CHECK ( ! get(copyFunctionCallTester1).is_copy_constructed); BOOST_CHECK ( ! get(copyFunctionCallTester1).is_copy_constructed);
BOOST_CHECK ( ! get(copyFunctionCallTester1).is_assignment_called); BOOST_CHECK ( ! get(copyFunctionCallTester1).is_assignment_called);