|
Boost-Commit : |
Subject: [Boost-commit] svn:boost r72387 - sandbox/conversion/libs/conversion_ext/test
From: vicente.botet_at_[hidden]
Date: 2011-06-04 12:10:36
Author: viboes
Date: 2011-06-04 12:10:35 EDT (Sat, 04 Jun 2011)
New Revision: 72387
URL: http://svn.boost.org/trac/boost/changeset/72387
Log:
Conversion: Continue adding enabling condition SFINAE
Added:
sandbox/conversion/libs/conversion_ext/test/is_assignable.cpp (contents, props changed)
sandbox/conversion/libs/conversion_ext/test/is_constructible.cpp (contents, props changed)
sandbox/conversion/libs/conversion_ext/test/is_copy_assignable.cpp (contents, props changed)
sandbox/conversion/libs/conversion_ext/test/is_copy_constructible.cpp (contents, props changed)
sandbox/conversion/libs/conversion_ext/test/is_explicitly_convertible.cpp (contents, props changed)
sandbox/conversion/libs/conversion_ext/test/is_extrinsic_assignable.cpp (contents, props changed)
sandbox/conversion/libs/conversion_ext/test/is_extrinsic_convertible.cpp (contents, props changed)
Text files modified:
sandbox/conversion/libs/conversion_ext/test/Jamfile.v2 | 9 +++++++++
sandbox/conversion/libs/conversion_ext/test/builtins.cpp | 1 -
sandbox/conversion/libs/conversion_ext/test/extrinsec.cpp | 4 ++--
sandbox/conversion/libs/conversion_ext/test/helper.hpp | 8 ++++----
sandbox/conversion/libs/conversion_ext/test/pair.cpp | 3 +++
5 files changed, 18 insertions(+), 7 deletions(-)
Modified: sandbox/conversion/libs/conversion_ext/test/Jamfile.v2
==============================================================================
--- sandbox/conversion/libs/conversion_ext/test/Jamfile.v2 (original)
+++ sandbox/conversion/libs/conversion_ext/test/Jamfile.v2 2011-06-04 12:10:35 EDT (Sat, 04 Jun 2011)
@@ -43,6 +43,15 @@
;
+test-suite "type_traits" :
+ [ compile is_assignable.cpp ]
+ [ compile is_constructible.cpp ]
+ [ compile is_copy_assignable.cpp ]
+ [ compile is_copy_constructible.cpp ]
+ [ compile is_explicitly_convertible.cpp ]
+ [ compile is_extrinsic_assignable.cpp ]
+ [ compile is_extrinsic_convertible.cpp ]
+ ;
test-suite "conversion" :
Modified: sandbox/conversion/libs/conversion_ext/test/builtins.cpp
==============================================================================
--- sandbox/conversion/libs/conversion_ext/test/builtins.cpp (original)
+++ sandbox/conversion/libs/conversion_ext/test/builtins.cpp 2011-06-04 12:10:35 EDT (Sat, 04 Jun 2011)
@@ -22,7 +22,6 @@
#include <boost/conversion/fp/convert_to.hpp>
#include <boost/phoenix/core/argument.hpp>
-//using namespace boost;
void convert_to_with_builtin_types() {
char c=0;
Modified: sandbox/conversion/libs/conversion_ext/test/extrinsec.cpp
==============================================================================
--- sandbox/conversion/libs/conversion_ext/test/extrinsec.cpp (original)
+++ sandbox/conversion/libs/conversion_ext/test/extrinsec.cpp 2011-06-04 12:10:35 EDT (Sat, 04 Jun 2011)
@@ -41,14 +41,14 @@
namespace boost {
namespace conversion {
template <>
- struct converter< A,B > {
+ struct converter< A,B > : true_type {
A operator()(B const &)
{
return A();
}
};
template <>
- struct converter< B,C > {
+ struct converter< B,C > : true_type {
B operator()(C const &)
{
return B();
Modified: sandbox/conversion/libs/conversion_ext/test/helper.hpp
==============================================================================
--- sandbox/conversion/libs/conversion_ext/test/helper.hpp (original)
+++ sandbox/conversion/libs/conversion_ext/test/helper.hpp 2011-06-04 12:10:35 EDT (Sat, 04 Jun 2011)
@@ -23,28 +23,28 @@
namespace boost {
namespace conversion {
template <>
- struct converter< A1,B1 > {
+ struct converter< A1,B1 > : true_type {
A1 operator()(B1 const &)
{
return A1();
}
};
template <>
- struct converter< A2,B2 > {
+ struct converter< A2,B2 > : true_type {
A2 operator()(B2 const &)
{
return A2();
}
};
template < >
- struct assigner< A1,B1 > {
+ struct assigner< A1,B1 > : true_type {
A1& operator()(A1& to, const B1&)
{
return to;
}
};
template < >
- struct assigner< A2,B2 > {
+ struct assigner< A2,B2 > : true_type {
A2& operator()(A2& to, const B2&)
{
return to;
Added: sandbox/conversion/libs/conversion_ext/test/is_assignable.cpp
==============================================================================
--- (empty file)
+++ sandbox/conversion/libs/conversion_ext/test/is_assignable.cpp 2011-06-04 12:10:35 EDT (Sat, 04 Jun 2011)
@@ -0,0 +1,37 @@
+//////////////////////////////////////////////////////////////////////////////
+//
+// (C) Copyright Vicente J. Botet Escriba 2011. 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)
+//
+// See http://www.boost.org/libs/conversion for documentation.
+//
+//////////////////////////////////////////////////////////////////////////////
+
+
+#include <iostream>
+#include <boost/static_assert.hpp>
+#include <boost/conversion/type_traits/is_assignable.hpp>
+
+
+struct A
+{
+};
+
+struct B
+{
+ void operator=(A);
+};
+
+
+int main()
+{
+ BOOST_STATIC_ASSERT(( boost::is_assignable<int&, int&>::value));
+ BOOST_STATIC_ASSERT(( boost::is_assignable<int&, int>::value));
+ //BOOST_STATIC_ASSERT((!boost::is_assignable<int, int&>::value));
+ BOOST_STATIC_ASSERT(( boost::is_assignable<int&, double>::value));
+ BOOST_STATIC_ASSERT(( boost::is_assignable<B, A>::value));
+ //BOOST_STATIC_ASSERT((!boost::is_assignable<A, B>::value));
+}
+
+
Added: sandbox/conversion/libs/conversion_ext/test/is_constructible.cpp
==============================================================================
--- (empty file)
+++ sandbox/conversion/libs/conversion_ext/test/is_constructible.cpp 2011-06-04 12:10:35 EDT (Sat, 04 Jun 2011)
@@ -0,0 +1,39 @@
+//////////////////////////////////////////////////////////////////////////////
+//
+// (C) Copyright Vicente J. Botet Escriba 2011. 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)
+//
+// See http://www.boost.org/libs/conversion for documentation.
+//
+//////////////////////////////////////////////////////////////////////////////
+
+
+#include <iostream>
+#include <boost/static_assert.hpp>
+#include <boost/conversion/type_traits/is_constructible.hpp>
+
+
+
+
+
+
+struct A
+{
+ explicit A(int);
+ A(double);
+ A(int, double);
+ A(A const&);
+};
+
+int main()
+{
+ BOOST_STATIC_ASSERT((boost::is_constructible<int>::value));
+ BOOST_STATIC_ASSERT((boost::is_constructible<int, const int>::value));
+ BOOST_STATIC_ASSERT((boost::is_constructible<A, int>::value));
+ BOOST_STATIC_ASSERT((boost::is_constructible<A, double>::value));
+ BOOST_STATIC_ASSERT((boost::is_constructible<A, int, double>::value));
+ BOOST_STATIC_ASSERT((boost::is_constructible<A, A const&>::value));
+ BOOST_STATIC_ASSERT((!boost::is_constructible<void>::value));
+ //BOOST_STATIC_ASSERT((!boost::is_constructible<A>::value));
+}
Added: sandbox/conversion/libs/conversion_ext/test/is_copy_assignable.cpp
==============================================================================
--- (empty file)
+++ sandbox/conversion/libs/conversion_ext/test/is_copy_assignable.cpp 2011-06-04 12:10:35 EDT (Sat, 04 Jun 2011)
@@ -0,0 +1,57 @@
+//////////////////////////////////////////////////////////////////////////////
+//
+// (C) Copyright Vicente J. Botet Escriba 2011. 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)
+//
+// See http://www.boost.org/libs/conversion for documentation.
+//
+//////////////////////////////////////////////////////////////////////////////
+
+
+#include <iostream>
+#include <boost/static_assert.hpp>
+#include <boost/conversion/type_traits/is_copy_assignable.hpp>
+
+
+
+class Empty
+{
+};
+
+class NotEmpty
+{
+public:
+ virtual ~NotEmpty();
+};
+
+union Union {};
+
+struct bit_zero
+{
+ int : 0;
+};
+
+struct A
+{
+ A();
+};
+
+int main()
+{
+ BOOST_STATIC_ASSERT(( boost::is_copy_assignable<int>::value));
+ //BOOST_STATIC_ASSERT((!boost::is_copy_assignable<const int>::value));
+ //BOOST_STATIC_ASSERT((!boost::is_copy_assignable<int[]>::value));
+ //BOOST_STATIC_ASSERT((!boost::is_copy_assignable<int[3]>::value));
+ BOOST_STATIC_ASSERT(( boost::is_copy_assignable<int&>::value));
+ BOOST_STATIC_ASSERT(( boost::is_copy_assignable<A>::value));
+ BOOST_STATIC_ASSERT(( boost::is_copy_assignable<bit_zero>::value));
+ BOOST_STATIC_ASSERT(( boost::is_copy_assignable<Union>::value));
+ BOOST_STATIC_ASSERT(( boost::is_copy_assignable<NotEmpty>::value));
+ BOOST_STATIC_ASSERT(( boost::is_copy_assignable<Empty>::value));
+}
+
+
+
+
+
Added: sandbox/conversion/libs/conversion_ext/test/is_copy_constructible.cpp
==============================================================================
--- (empty file)
+++ sandbox/conversion/libs/conversion_ext/test/is_copy_constructible.cpp 2011-06-04 12:10:35 EDT (Sat, 04 Jun 2011)
@@ -0,0 +1,66 @@
+//////////////////////////////////////////////////////////////////////////////
+//
+// (C) Copyright Vicente J. Botet Escriba 2011. 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)
+//
+// See http://www.boost.org/libs/conversion for documentation.
+//
+//////////////////////////////////////////////////////////////////////////////
+
+
+#include <iostream>
+#include <boost/static_assert.hpp>
+#include <boost/conversion/type_traits/is_copy_constructible.hpp>
+
+
+
+
+class Empty
+{
+};
+
+class NotEmpty
+{
+public:
+ virtual ~NotEmpty();
+};
+
+union Union {};
+
+struct bit_zero
+{
+ int : 0;
+};
+
+class Abstract
+{
+public:
+ virtual ~Abstract() = 0;
+};
+
+struct A
+{
+ A(const A&);
+};
+
+int main()
+{
+ BOOST_STATIC_ASSERT((!boost::is_copy_constructible<Abstract>::value));
+ BOOST_STATIC_ASSERT((!boost::is_copy_constructible<void>::value));
+ //BOOST_STATIC_ASSERT((!boost::is_copy_constructible<int[]>::value));
+ //BOOST_STATIC_ASSERT((!boost::is_copy_constructible<int[3]>::value));
+
+ BOOST_STATIC_ASSERT(( boost::is_copy_constructible<A>::value));
+ BOOST_STATIC_ASSERT(( boost::is_copy_constructible<int&>::value));
+ BOOST_STATIC_ASSERT(( boost::is_copy_constructible<bit_zero>::value));
+ BOOST_STATIC_ASSERT(( boost::is_copy_constructible<Union>::value));
+ BOOST_STATIC_ASSERT(( boost::is_copy_constructible<NotEmpty>::value));
+ BOOST_STATIC_ASSERT(( boost::is_copy_constructible<Empty>::value));
+ BOOST_STATIC_ASSERT(( boost::is_copy_constructible<int>::value));
+ BOOST_STATIC_ASSERT(( boost::is_copy_constructible<double>::value));
+ BOOST_STATIC_ASSERT(( boost::is_copy_constructible<int*>::value));
+ BOOST_STATIC_ASSERT(( boost::is_copy_constructible<const int*>::value));
+}
+
+
Added: sandbox/conversion/libs/conversion_ext/test/is_explicitly_convertible.cpp
==============================================================================
--- (empty file)
+++ sandbox/conversion/libs/conversion_ext/test/is_explicitly_convertible.cpp 2011-06-04 12:10:35 EDT (Sat, 04 Jun 2011)
@@ -0,0 +1,36 @@
+//////////////////////////////////////////////////////////////////////////////
+//
+// (C) Copyright Vicente J. Botet Escriba 2011. 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)
+//
+// See http://www.boost.org/libs/conversion for documentation.
+//
+//////////////////////////////////////////////////////////////////////////////
+
+
+#include <iostream>
+#include <boost/static_assert.hpp>
+#include <boost/conversion/type_traits/is_explicitly_convertible.hpp>
+
+
+
+
+
+
+struct A
+{
+ explicit A(int);
+ A(double);
+ A(int, double);
+ A(A const&);
+};
+
+int main()
+{
+ BOOST_STATIC_ASSERT((boost::is_explicitly_convertible<const int, int>::value));
+ BOOST_STATIC_ASSERT((boost::is_explicitly_convertible<int, A>::value));
+ BOOST_STATIC_ASSERT((boost::is_explicitly_convertible<double, A>::value));
+ BOOST_STATIC_ASSERT((!boost::is_explicitly_convertible<void,A>::value));
+ //BOOST_STATIC_ASSERT((!boost::is_explicitly_convertible<A>::value));
+}
Added: sandbox/conversion/libs/conversion_ext/test/is_extrinsic_assignable.cpp
==============================================================================
--- (empty file)
+++ sandbox/conversion/libs/conversion_ext/test/is_extrinsic_assignable.cpp 2011-06-04 12:10:35 EDT (Sat, 04 Jun 2011)
@@ -0,0 +1,20 @@
+//////////////////////////////////////////////////////////////////////////////
+//
+// (C) Copyright Vicente J. Botet Escriba 2011. 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)
+//
+// See http://www.boost.org/libs/conversion for documentation.
+//
+//////////////////////////////////////////////////////////////////////////////
+
+
+#include <iostream>
+#include <boost/static_assert.hpp>
+#include <boost/conversion/type_traits/is_extrinsic_assignable.hpp>
+
+
+
+
+
+
Added: sandbox/conversion/libs/conversion_ext/test/is_extrinsic_convertible.cpp
==============================================================================
--- (empty file)
+++ sandbox/conversion/libs/conversion_ext/test/is_extrinsic_convertible.cpp 2011-06-04 12:10:35 EDT (Sat, 04 Jun 2011)
@@ -0,0 +1,386 @@
+//////////////////////////////////////////////////////////////////////////////
+//
+// (C) Copyright Vicente J. Botet Escriba 2011. 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)
+//
+// See http://www.boost.org/libs/conversion for documentation.
+//
+//////////////////////////////////////////////////////////////////////////////
+
+
+#include <iostream>
+#include <boost/static_assert.hpp>
+#include <boost/conversion/type_traits/is_extrinsic_convertible.hpp>
+#include <boost/type_traits/is_convertible.hpp>
+
+
+typedef void Function();
+typedef char Array[1];
+
+class NonCopyable {
+ NonCopyable(NonCopyable&);
+};
+
+
+int main()
+{
+
+ {
+ BOOST_STATIC_ASSERT(( boost::is_extrinsic_convertible<void, void>::value));
+ BOOST_STATIC_ASSERT(( boost::is_extrinsic_convertible<const void, void>::value));
+ BOOST_STATIC_ASSERT(( boost::is_extrinsic_convertible<void, const void>::value));
+ BOOST_STATIC_ASSERT(( boost::is_extrinsic_convertible<const void, const void>::value));
+
+ BOOST_STATIC_ASSERT((!boost::is_extrinsic_convertible<void, Function>::value));
+ BOOST_STATIC_ASSERT((!boost::is_extrinsic_convertible<const void, Function>::value));
+
+ BOOST_STATIC_ASSERT((!boost::is_extrinsic_convertible<void, Function&>::value));
+ BOOST_STATIC_ASSERT((!boost::is_extrinsic_convertible<const void, Function&>::value));
+
+ BOOST_STATIC_ASSERT((!boost::is_extrinsic_convertible<void, Function*>::value));
+ BOOST_STATIC_ASSERT((!boost::is_extrinsic_convertible<void, Function* const>::value));
+ BOOST_STATIC_ASSERT((!boost::is_extrinsic_convertible<const void, Function*>::value));
+ BOOST_STATIC_ASSERT((!boost::is_extrinsic_convertible<const void, Function*const >::value));
+
+ BOOST_STATIC_ASSERT((!boost::is_extrinsic_convertible<void, Array>::value));
+ BOOST_STATIC_ASSERT((!boost::is_extrinsic_convertible<void, const Array>::value));
+ BOOST_STATIC_ASSERT((!boost::is_extrinsic_convertible<const void, Array>::value));
+ BOOST_STATIC_ASSERT((!boost::is_extrinsic_convertible<const void, const Array>::value));
+
+ BOOST_STATIC_ASSERT((!boost::is_extrinsic_convertible<void, Array&>::value));
+ BOOST_STATIC_ASSERT((!boost::is_extrinsic_convertible<void, const Array&>::value));
+ BOOST_STATIC_ASSERT((!boost::is_extrinsic_convertible<const void, Array&>::value));
+ BOOST_STATIC_ASSERT((!boost::is_extrinsic_convertible<const void, const Array&>::value));
+
+ BOOST_STATIC_ASSERT((!boost::is_extrinsic_convertible<void, char>::value));
+ BOOST_STATIC_ASSERT((!boost::is_extrinsic_convertible<void, const char>::value));
+ BOOST_STATIC_ASSERT((!boost::is_extrinsic_convertible<const void, char>::value));
+ BOOST_STATIC_ASSERT((!boost::is_extrinsic_convertible<const void, const char>::value));
+
+ BOOST_STATIC_ASSERT((!boost::is_extrinsic_convertible<void, char&>::value));
+ BOOST_STATIC_ASSERT((!boost::is_extrinsic_convertible<void, const char&>::value));
+ BOOST_STATIC_ASSERT((!boost::is_extrinsic_convertible<const void, char&>::value));
+ BOOST_STATIC_ASSERT((!boost::is_extrinsic_convertible<const void, const char&>::value));
+
+ BOOST_STATIC_ASSERT((!boost::is_extrinsic_convertible<void, char*>::value));
+ BOOST_STATIC_ASSERT((!boost::is_extrinsic_convertible<void, const char*>::value));
+ BOOST_STATIC_ASSERT((!boost::is_extrinsic_convertible<const void, char*>::value));
+ BOOST_STATIC_ASSERT((!boost::is_extrinsic_convertible<const void, const char*>::value));
+ }
+ {
+ BOOST_STATIC_ASSERT((!boost::is_extrinsic_convertible<Function, void>::value));
+ BOOST_STATIC_ASSERT((!boost::is_extrinsic_convertible<Function, const void>::value));
+
+ //BOOST_STATIC_ASSERT((!boost::is_extrinsic_convertible<Function, Function>::value));
+
+ BOOST_STATIC_ASSERT(( boost::is_extrinsic_convertible<Function, Function&>::value));
+
+ BOOST_STATIC_ASSERT(( boost::is_extrinsic_convertible<Function, Function*>::value));
+ BOOST_STATIC_ASSERT(( boost::is_extrinsic_convertible<Function, Function* const>::value));
+
+ BOOST_STATIC_ASSERT((!boost::is_extrinsic_convertible<Function, Array>::value));
+ BOOST_STATIC_ASSERT((!boost::is_extrinsic_convertible<Function, const Array>::value));
+
+ BOOST_STATIC_ASSERT((!boost::is_extrinsic_convertible<Function, Array&>::value));
+ BOOST_STATIC_ASSERT((!boost::is_extrinsic_convertible<Function, const Array&>::value));
+
+ BOOST_STATIC_ASSERT((!boost::is_extrinsic_convertible<Function, char>::value));
+ BOOST_STATIC_ASSERT((!boost::is_extrinsic_convertible<Function, const char>::value));
+
+ BOOST_STATIC_ASSERT((!boost::is_extrinsic_convertible<Function, char&>::value));
+ BOOST_STATIC_ASSERT((!boost::is_extrinsic_convertible<Function, const char&>::value));
+
+ BOOST_STATIC_ASSERT((!boost::is_extrinsic_convertible<Function, char*>::value));
+ BOOST_STATIC_ASSERT((!boost::is_extrinsic_convertible<Function, const char*>::value));
+ }
+ {
+ BOOST_STATIC_ASSERT((!boost::is_extrinsic_convertible<Function&, void>::value));
+ BOOST_STATIC_ASSERT((!boost::is_extrinsic_convertible<Function&, const void>::value));
+
+ //BOOST_STATIC_ASSERT((!boost::is_extrinsic_convertible<Function&, Function>::value));
+
+ BOOST_STATIC_ASSERT(( boost::is_extrinsic_convertible<Function&, Function&>::value));
+
+ BOOST_STATIC_ASSERT(( boost::is_extrinsic_convertible<Function&, Function*>::value));
+ BOOST_STATIC_ASSERT(( boost::is_extrinsic_convertible<Function&, Function* const>::value));
+
+ BOOST_STATIC_ASSERT((!boost::is_extrinsic_convertible<Function&, Array>::value));
+ BOOST_STATIC_ASSERT((!boost::is_extrinsic_convertible<Function&, const Array>::value));
+
+ BOOST_STATIC_ASSERT((!boost::is_extrinsic_convertible<Function&, Array&>::value));
+ BOOST_STATIC_ASSERT((!boost::is_extrinsic_convertible<Function&, const Array&>::value));
+
+ BOOST_STATIC_ASSERT((!boost::is_extrinsic_convertible<Function&, char>::value));
+ BOOST_STATIC_ASSERT((!boost::is_extrinsic_convertible<Function&, const char>::value));
+
+ BOOST_STATIC_ASSERT((!boost::is_extrinsic_convertible<Function&, char&>::value));
+ BOOST_STATIC_ASSERT((!boost::is_extrinsic_convertible<Function&, const char&>::value));
+
+ BOOST_STATIC_ASSERT((!boost::is_extrinsic_convertible<Function&, char*>::value));
+ BOOST_STATIC_ASSERT((!boost::is_extrinsic_convertible<Function&, const char*>::value));
+ }
+ {
+ BOOST_STATIC_ASSERT((!boost::is_extrinsic_convertible<Function*, void>::value));
+ BOOST_STATIC_ASSERT((!boost::is_extrinsic_convertible<Function*const, void>::value));
+ BOOST_STATIC_ASSERT((!boost::is_extrinsic_convertible<Function*, const void>::value));
+ BOOST_STATIC_ASSERT((!boost::is_extrinsic_convertible<Function*const, const void>::value));
+
+ //BOOST_STATIC_ASSERT((!boost::is_extrinsic_convertible<Function*, Function>::value));
+ //BOOST_STATIC_ASSERT((!boost::is_extrinsic_convertible<Function*const, Function>::value));
+
+ BOOST_STATIC_ASSERT((!boost::is_extrinsic_convertible<Function*, Function&>::value));
+ BOOST_STATIC_ASSERT((!boost::is_extrinsic_convertible<Function*const, Function&>::value));
+
+ BOOST_STATIC_ASSERT(( boost::is_extrinsic_convertible<Function*, Function*>::value));
+ BOOST_STATIC_ASSERT(( boost::is_extrinsic_convertible<Function*, Function* const>::value));
+ BOOST_STATIC_ASSERT(( boost::is_extrinsic_convertible<Function*const, Function*>::value));
+ BOOST_STATIC_ASSERT(( boost::is_extrinsic_convertible<Function*const, Function*const >::value));
+
+ BOOST_STATIC_ASSERT((!boost::is_extrinsic_convertible<Function*, Array>::value));
+ BOOST_STATIC_ASSERT((!boost::is_extrinsic_convertible<Function*, const Array>::value));
+ BOOST_STATIC_ASSERT((!boost::is_extrinsic_convertible<Function*const, Array>::value));
+ BOOST_STATIC_ASSERT((!boost::is_extrinsic_convertible<Function*const, const Array>::value));
+
+ BOOST_STATIC_ASSERT((!boost::is_extrinsic_convertible<Function*, Array&>::value));
+ BOOST_STATIC_ASSERT((!boost::is_extrinsic_convertible<Function*, const Array&>::value));
+ BOOST_STATIC_ASSERT((!boost::is_extrinsic_convertible<Function*const, Array&>::value));
+ BOOST_STATIC_ASSERT((!boost::is_extrinsic_convertible<Function*const, const Array&>::value));
+
+ BOOST_STATIC_ASSERT((!boost::is_extrinsic_convertible<Function*, char>::value));
+ BOOST_STATIC_ASSERT((!boost::is_extrinsic_convertible<Function*, const char>::value));
+ BOOST_STATIC_ASSERT((!boost::is_extrinsic_convertible<Function*const, char>::value));
+ BOOST_STATIC_ASSERT((!boost::is_extrinsic_convertible<Function*const, const char>::value));
+
+ BOOST_STATIC_ASSERT((!boost::is_extrinsic_convertible<Function*, char&>::value));
+ BOOST_STATIC_ASSERT((!boost::is_extrinsic_convertible<Function*, const char&>::value));
+ BOOST_STATIC_ASSERT((!boost::is_extrinsic_convertible<Function*const, char&>::value));
+ BOOST_STATIC_ASSERT((!boost::is_extrinsic_convertible<Function*const, const char&>::value));
+
+ BOOST_STATIC_ASSERT((!boost::is_extrinsic_convertible<Function*, char*>::value));
+ BOOST_STATIC_ASSERT((!boost::is_extrinsic_convertible<Function*, const char*>::value));
+ BOOST_STATIC_ASSERT((!boost::is_extrinsic_convertible<Function*const, char*>::value));
+ BOOST_STATIC_ASSERT((!boost::is_extrinsic_convertible<Function*const, const char*>::value));
+ }
+ {
+ BOOST_STATIC_ASSERT((!boost::is_extrinsic_convertible<Array, void>::value));
+ BOOST_STATIC_ASSERT((!boost::is_extrinsic_convertible<const Array, void>::value));
+ BOOST_STATIC_ASSERT((!boost::is_extrinsic_convertible<Array, const void>::value));
+ BOOST_STATIC_ASSERT((!boost::is_extrinsic_convertible<const Array, const void>::value));
+
+ BOOST_STATIC_ASSERT((!boost::is_extrinsic_convertible<Array, Function>::value));
+ BOOST_STATIC_ASSERT((!boost::is_extrinsic_convertible<const Array, Function>::value));
+
+ BOOST_STATIC_ASSERT((!boost::is_extrinsic_convertible<Array, Function&>::value));
+ BOOST_STATIC_ASSERT((!boost::is_extrinsic_convertible<const Array, Function&>::value));
+
+ BOOST_STATIC_ASSERT((!boost::is_extrinsic_convertible<Array, Function*>::value));
+ BOOST_STATIC_ASSERT((!boost::is_extrinsic_convertible<Array, Function* const>::value));
+ BOOST_STATIC_ASSERT((!boost::is_extrinsic_convertible<const Array, Function*>::value));
+ BOOST_STATIC_ASSERT((!boost::is_extrinsic_convertible<const Array, Function*const >::value));
+
+ BOOST_STATIC_ASSERT((!boost::is_extrinsic_convertible<Array, Array>::value));
+ BOOST_STATIC_ASSERT((!boost::is_extrinsic_convertible<Array, const Array>::value));
+ BOOST_STATIC_ASSERT((!boost::is_extrinsic_convertible<const Array, Array>::value));
+ BOOST_STATIC_ASSERT((!boost::is_extrinsic_convertible<const Array, const Array>::value));
+
+ //BOOST_STATIC_ASSERT((!boost::is_extrinsic_convertible<Array, Array&>::value));
+ BOOST_STATIC_ASSERT(( boost::is_extrinsic_convertible<Array, const Array&>::value));
+ BOOST_STATIC_ASSERT((!boost::is_extrinsic_convertible<const Array, Array&>::value));
+ BOOST_STATIC_ASSERT(( boost::is_extrinsic_convertible<const Array, const Array&>::value));
+
+ BOOST_STATIC_ASSERT((!boost::is_extrinsic_convertible<Array, char>::value));
+ BOOST_STATIC_ASSERT((!boost::is_extrinsic_convertible<Array, const char>::value));
+ BOOST_STATIC_ASSERT((!boost::is_extrinsic_convertible<const Array, char>::value));
+ BOOST_STATIC_ASSERT((!boost::is_extrinsic_convertible<const Array, const char>::value));
+
+ BOOST_STATIC_ASSERT((!boost::is_extrinsic_convertible<Array, char&>::value));
+ BOOST_STATIC_ASSERT((!boost::is_extrinsic_convertible<Array, const char&>::value));
+ BOOST_STATIC_ASSERT((!boost::is_extrinsic_convertible<const Array, char&>::value));
+ BOOST_STATIC_ASSERT((!boost::is_extrinsic_convertible<const Array, const char&>::value));
+
+ BOOST_STATIC_ASSERT(( boost::is_extrinsic_convertible<Array, char*>::value));
+ BOOST_STATIC_ASSERT(( boost::is_extrinsic_convertible<Array, const char*>::value));
+ BOOST_STATIC_ASSERT((!boost::is_extrinsic_convertible<const Array, char*>::value));
+ BOOST_STATIC_ASSERT(( boost::is_extrinsic_convertible<const Array, const char*>::value));
+ }
+ {
+ BOOST_STATIC_ASSERT((!boost::is_extrinsic_convertible<Array&, void>::value));
+ BOOST_STATIC_ASSERT((!boost::is_extrinsic_convertible<const Array&, void>::value));
+ BOOST_STATIC_ASSERT((!boost::is_extrinsic_convertible<Array&, const void>::value));
+ BOOST_STATIC_ASSERT((!boost::is_extrinsic_convertible<const Array&, const void>::value));
+
+ BOOST_STATIC_ASSERT((!boost::is_extrinsic_convertible<Array&, Function>::value));
+ BOOST_STATIC_ASSERT((!boost::is_extrinsic_convertible<const Array&, Function>::value));
+
+ BOOST_STATIC_ASSERT((!boost::is_extrinsic_convertible<Array&, Function&>::value));
+ BOOST_STATIC_ASSERT((!boost::is_extrinsic_convertible<const Array&, Function&>::value));
+
+ BOOST_STATIC_ASSERT((!boost::is_extrinsic_convertible<Array&, Function*>::value));
+ BOOST_STATIC_ASSERT((!boost::is_extrinsic_convertible<Array&, Function* const>::value));
+ BOOST_STATIC_ASSERT((!boost::is_extrinsic_convertible<const Array&, Function*>::value));
+ BOOST_STATIC_ASSERT((!boost::is_extrinsic_convertible<const Array&, Function*const >::value));
+
+ BOOST_STATIC_ASSERT((!boost::is_extrinsic_convertible<Array&, Array>::value));
+ BOOST_STATIC_ASSERT((!boost::is_extrinsic_convertible<Array&, const Array>::value));
+ BOOST_STATIC_ASSERT((!boost::is_extrinsic_convertible<const Array&, Array>::value));
+ BOOST_STATIC_ASSERT((!boost::is_extrinsic_convertible<const Array&, const Array>::value));
+
+ BOOST_STATIC_ASSERT(( boost::is_extrinsic_convertible<Array&, Array&>::value));
+ BOOST_STATIC_ASSERT(( boost::is_extrinsic_convertible<Array&, const Array&>::value));
+ BOOST_STATIC_ASSERT((!boost::is_extrinsic_convertible<const Array&, Array&>::value));
+ BOOST_STATIC_ASSERT(( boost::is_extrinsic_convertible<const Array&, const Array&>::value));
+
+ BOOST_STATIC_ASSERT((!boost::is_extrinsic_convertible<Array&, char>::value));
+ BOOST_STATIC_ASSERT((!boost::is_extrinsic_convertible<Array&, const char>::value));
+ BOOST_STATIC_ASSERT((!boost::is_extrinsic_convertible<const Array&, char>::value));
+ BOOST_STATIC_ASSERT((!boost::is_extrinsic_convertible<const Array&, const char>::value));
+
+ BOOST_STATIC_ASSERT((!boost::is_extrinsic_convertible<Array&, char&>::value));
+ BOOST_STATIC_ASSERT((!boost::is_extrinsic_convertible<Array&, const char&>::value));
+ BOOST_STATIC_ASSERT((!boost::is_extrinsic_convertible<const Array&, char&>::value));
+ BOOST_STATIC_ASSERT((!boost::is_extrinsic_convertible<const Array&, const char&>::value));
+
+ BOOST_STATIC_ASSERT(( boost::is_extrinsic_convertible<Array&, char*>::value));
+ BOOST_STATIC_ASSERT(( boost::is_extrinsic_convertible<Array&, const char*>::value));
+ BOOST_STATIC_ASSERT((!boost::is_extrinsic_convertible<const Array&, char*>::value));
+ BOOST_STATIC_ASSERT(( boost::is_extrinsic_convertible<const Array&, const char*>::value));
+ }
+ {
+ BOOST_STATIC_ASSERT((!boost::is_extrinsic_convertible<char, void>::value));
+ BOOST_STATIC_ASSERT((!boost::is_extrinsic_convertible<const char, void>::value));
+ BOOST_STATIC_ASSERT((!boost::is_extrinsic_convertible<char, const void>::value));
+ BOOST_STATIC_ASSERT((!boost::is_extrinsic_convertible<const char, const void>::value));
+
+ BOOST_STATIC_ASSERT((!boost::is_extrinsic_convertible<char, Function>::value));
+ BOOST_STATIC_ASSERT((!boost::is_extrinsic_convertible<const char, Function>::value));
+
+ BOOST_STATIC_ASSERT((!boost::is_extrinsic_convertible<char, Function&>::value));
+ BOOST_STATIC_ASSERT((!boost::is_extrinsic_convertible<const char, Function&>::value));
+
+ BOOST_STATIC_ASSERT((!boost::is_extrinsic_convertible<char, Function*>::value));
+ BOOST_STATIC_ASSERT((!boost::is_extrinsic_convertible<char, Function* const>::value));
+ BOOST_STATIC_ASSERT((!boost::is_extrinsic_convertible<const char, Function*>::value));
+ BOOST_STATIC_ASSERT((!boost::is_extrinsic_convertible<const char, Function*const >::value));
+
+ BOOST_STATIC_ASSERT((!boost::is_extrinsic_convertible<char, Array>::value));
+ BOOST_STATIC_ASSERT((!boost::is_extrinsic_convertible<char, const Array>::value));
+ BOOST_STATIC_ASSERT((!boost::is_extrinsic_convertible<const char, Array>::value));
+ BOOST_STATIC_ASSERT((!boost::is_extrinsic_convertible<const char, const Array>::value));
+
+ BOOST_STATIC_ASSERT((!boost::is_extrinsic_convertible<char, Array&>::value));
+ BOOST_STATIC_ASSERT((!boost::is_extrinsic_convertible<char, const Array&>::value));
+ BOOST_STATIC_ASSERT((!boost::is_extrinsic_convertible<const char, Array&>::value));
+ BOOST_STATIC_ASSERT((!boost::is_extrinsic_convertible<const char, const Array&>::value));
+
+ BOOST_STATIC_ASSERT(( boost::is_extrinsic_convertible<char, char>::value));
+ BOOST_STATIC_ASSERT(( boost::is_extrinsic_convertible<char, const char>::value));
+ BOOST_STATIC_ASSERT(( boost::is_extrinsic_convertible<const char, char>::value));
+ BOOST_STATIC_ASSERT(( boost::is_extrinsic_convertible<const char, const char>::value));
+
+ //BOOST_STATIC_ASSERT((!boost::is_extrinsic_convertible<char, char&>::value));
+ BOOST_STATIC_ASSERT(( boost::is_extrinsic_convertible<char, const char&>::value));
+ BOOST_STATIC_ASSERT((!boost::is_extrinsic_convertible<const char, char&>::value));
+ BOOST_STATIC_ASSERT(( boost::is_extrinsic_convertible<const char, const char&>::value));
+
+ BOOST_STATIC_ASSERT((!boost::is_extrinsic_convertible<char, char*>::value));
+ BOOST_STATIC_ASSERT((!boost::is_extrinsic_convertible<char, const char*>::value));
+ BOOST_STATIC_ASSERT((!boost::is_extrinsic_convertible<const char, char*>::value));
+ BOOST_STATIC_ASSERT((!boost::is_extrinsic_convertible<const char, const char*>::value));
+ }
+ {
+ BOOST_STATIC_ASSERT((!boost::is_extrinsic_convertible<char&, void>::value));
+ BOOST_STATIC_ASSERT((!boost::is_extrinsic_convertible<const char&, void>::value));
+ BOOST_STATIC_ASSERT((!boost::is_extrinsic_convertible<char&, const void>::value));
+ BOOST_STATIC_ASSERT((!boost::is_extrinsic_convertible<const char&, const void>::value));
+
+ BOOST_STATIC_ASSERT((!boost::is_extrinsic_convertible<char&, Function>::value));
+ BOOST_STATIC_ASSERT((!boost::is_extrinsic_convertible<const char&, Function>::value));
+
+ BOOST_STATIC_ASSERT((!boost::is_extrinsic_convertible<char&, Function&>::value));
+ BOOST_STATIC_ASSERT((!boost::is_extrinsic_convertible<const char&, Function&>::value));
+
+ BOOST_STATIC_ASSERT((!boost::is_extrinsic_convertible<char&, Function*>::value));
+ BOOST_STATIC_ASSERT((!boost::is_extrinsic_convertible<char&, Function* const>::value));
+ BOOST_STATIC_ASSERT((!boost::is_extrinsic_convertible<const char&, Function*>::value));
+ BOOST_STATIC_ASSERT((!boost::is_extrinsic_convertible<const char&, Function*const >::value));
+
+ BOOST_STATIC_ASSERT((!boost::is_extrinsic_convertible<char&, Array>::value));
+ BOOST_STATIC_ASSERT((!boost::is_extrinsic_convertible<char&, const Array>::value));
+ BOOST_STATIC_ASSERT((!boost::is_extrinsic_convertible<const char&, Array>::value));
+ BOOST_STATIC_ASSERT((!boost::is_extrinsic_convertible<const char&, const Array>::value));
+
+ BOOST_STATIC_ASSERT((!boost::is_extrinsic_convertible<char&, Array&>::value));
+ BOOST_STATIC_ASSERT((!boost::is_extrinsic_convertible<char&, const Array&>::value));
+ BOOST_STATIC_ASSERT((!boost::is_extrinsic_convertible<const char&, Array&>::value));
+ BOOST_STATIC_ASSERT((!boost::is_extrinsic_convertible<const char&, const Array&>::value));
+
+ BOOST_STATIC_ASSERT(( boost::is_extrinsic_convertible<char&, char>::value));
+ BOOST_STATIC_ASSERT(( boost::is_extrinsic_convertible<char&, const char>::value));
+ BOOST_STATIC_ASSERT(( boost::is_extrinsic_convertible<const char&, char>::value));
+ BOOST_STATIC_ASSERT(( boost::is_extrinsic_convertible<const char&, const char>::value));
+
+ BOOST_STATIC_ASSERT(( boost::is_extrinsic_convertible<char&, char&>::value));
+ BOOST_STATIC_ASSERT(( boost::is_extrinsic_convertible<char&, const char&>::value));
+ BOOST_STATIC_ASSERT((!boost::is_extrinsic_convertible<const char&, char&>::value));
+ BOOST_STATIC_ASSERT(( boost::is_extrinsic_convertible<const char&, const char&>::value));
+
+ BOOST_STATIC_ASSERT((!boost::is_extrinsic_convertible<char&, char*>::value));
+ BOOST_STATIC_ASSERT((!boost::is_extrinsic_convertible<char&, const char*>::value));
+ BOOST_STATIC_ASSERT((!boost::is_extrinsic_convertible<const char&, char*>::value));
+ BOOST_STATIC_ASSERT((!boost::is_extrinsic_convertible<const char&, const char*>::value));
+ }
+ {
+ BOOST_STATIC_ASSERT((!boost::is_extrinsic_convertible<char*, void>::value));
+ BOOST_STATIC_ASSERT((!boost::is_extrinsic_convertible<const char*, void>::value));
+ BOOST_STATIC_ASSERT((!boost::is_extrinsic_convertible<char*, const void>::value));
+ BOOST_STATIC_ASSERT((!boost::is_extrinsic_convertible<const char*, const void>::value));
+
+ BOOST_STATIC_ASSERT((!boost::is_extrinsic_convertible<char*, Function>::value));
+ BOOST_STATIC_ASSERT((!boost::is_extrinsic_convertible<const char*, Function>::value));
+
+ BOOST_STATIC_ASSERT((!boost::is_extrinsic_convertible<char*, Function&>::value));
+ BOOST_STATIC_ASSERT((!boost::is_extrinsic_convertible<const char*, Function&>::value));
+
+ BOOST_STATIC_ASSERT((!boost::is_extrinsic_convertible<char*, Function*>::value));
+ BOOST_STATIC_ASSERT((!boost::is_extrinsic_convertible<char*, Function* const>::value));
+ BOOST_STATIC_ASSERT((!boost::is_extrinsic_convertible<const char*, Function*>::value));
+ BOOST_STATIC_ASSERT((!boost::is_extrinsic_convertible<const char*, Function*const >::value));
+
+ BOOST_STATIC_ASSERT((!boost::is_extrinsic_convertible<char*, Array>::value));
+ BOOST_STATIC_ASSERT((!boost::is_extrinsic_convertible<char*, const Array>::value));
+ BOOST_STATIC_ASSERT((!boost::is_extrinsic_convertible<const char*, Array>::value));
+ BOOST_STATIC_ASSERT((!boost::is_extrinsic_convertible<const char*, const Array>::value));
+
+ BOOST_STATIC_ASSERT((!boost::is_extrinsic_convertible<char*, Array&>::value));
+ BOOST_STATIC_ASSERT((!boost::is_extrinsic_convertible<char*, const Array&>::value));
+ BOOST_STATIC_ASSERT((!boost::is_extrinsic_convertible<const char*, Array&>::value));
+ BOOST_STATIC_ASSERT((!boost::is_extrinsic_convertible<const char*, const Array&>::value));
+
+ BOOST_STATIC_ASSERT((!boost::is_extrinsic_convertible<char*, char>::value));
+ BOOST_STATIC_ASSERT((!boost::is_extrinsic_convertible<char*, const char>::value));
+ BOOST_STATIC_ASSERT((!boost::is_extrinsic_convertible<const char*, char>::value));
+ BOOST_STATIC_ASSERT((!boost::is_extrinsic_convertible<const char*, const char>::value));
+
+ BOOST_STATIC_ASSERT((!boost::is_extrinsic_convertible<char*, char&>::value));
+ BOOST_STATIC_ASSERT((!boost::is_extrinsic_convertible<char*, const char&>::value));
+ BOOST_STATIC_ASSERT((!boost::is_extrinsic_convertible<const char*, char&>::value));
+ BOOST_STATIC_ASSERT((!boost::is_extrinsic_convertible<const char*, const char&>::value));
+
+ BOOST_STATIC_ASSERT(( boost::is_extrinsic_convertible<char*, char*>::value));
+ BOOST_STATIC_ASSERT(( boost::is_extrinsic_convertible<char*, const char*>::value));
+ BOOST_STATIC_ASSERT((!boost::is_extrinsic_convertible<const char*, char*>::value));
+ BOOST_STATIC_ASSERT(( boost::is_extrinsic_convertible<const char*, const char*>::value));
+ }
+ {
+ BOOST_STATIC_ASSERT((boost::is_extrinsic_convertible<NonCopyable&, NonCopyable&>::value));
+ BOOST_STATIC_ASSERT((boost::is_extrinsic_convertible<NonCopyable&, const NonCopyable&>::value));
+ BOOST_STATIC_ASSERT((boost::is_extrinsic_convertible<NonCopyable&, const volatile NonCopyable&>::value));
+ BOOST_STATIC_ASSERT((boost::is_extrinsic_convertible<NonCopyable&, volatile NonCopyable&>::value));
+ BOOST_STATIC_ASSERT((boost::is_extrinsic_convertible<const NonCopyable&, const NonCopyable&>::value));
+ BOOST_STATIC_ASSERT((boost::is_extrinsic_convertible<const NonCopyable&, const volatile NonCopyable&>::value));
+ BOOST_STATIC_ASSERT((boost::is_extrinsic_convertible<volatile NonCopyable&, const volatile NonCopyable&>::value));
+ BOOST_STATIC_ASSERT((boost::is_extrinsic_convertible<const volatile NonCopyable&, const volatile NonCopyable&>::value));
+ BOOST_STATIC_ASSERT((!boost::is_extrinsic_convertible<const NonCopyable&, NonCopyable&>::value));
+ }
+}
Modified: sandbox/conversion/libs/conversion_ext/test/pair.cpp
==============================================================================
--- sandbox/conversion/libs/conversion_ext/test/pair.cpp (original)
+++ sandbox/conversion/libs/conversion_ext/test/pair.cpp 2011-06-04 12:10:35 EDT (Sat, 04 Jun 2011)
@@ -17,6 +17,9 @@
using namespace boost;
+BOOST_STATIC_ASSERT(( boost::is_extrinsic_convertible<B1, A1>::value));
+BOOST_STATIC_ASSERT(( boost::is_extrinsic_convertible<B2, A2>::value));
+
void explicit_convert_to() {
B1 b1;
B2 b2;
Boost-Commit list run by bdawes at acm.org, david.abrahams at rcn.com, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk