|
Boost-Commit : |
Subject: [Boost-commit] svn:boost r73142 - sandbox/conversion/libs/conversion_ext/test
From: vicente.botet_at_[hidden]
Date: 2011-07-16 07:54:34
Author: viboes
Date: 2011-07-16 07:54:33 EDT (Sat, 16 Jul 2011)
New Revision: 73142
URL: http://svn.boost.org/trac/boost/changeset/73142
Log:
conversion: is_explicitly_convertible uses now an independent implementation from is_constructible, based on static_cast.
Text files modified:
sandbox/conversion/libs/conversion_ext/test/intrinsec.cpp | 9 +++++++++
sandbox/conversion/libs/conversion_ext/test/is_constructible.cpp | 1 -
sandbox/conversion/libs/conversion_ext/test/is_copy_assignable.cpp | 6 +++---
sandbox/conversion/libs/conversion_ext/test/is_explicitly_convertible.cpp | 5 ++---
4 files changed, 14 insertions(+), 7 deletions(-)
Modified: sandbox/conversion/libs/conversion_ext/test/intrinsec.cpp
==============================================================================
--- sandbox/conversion/libs/conversion_ext/test/intrinsec.cpp (original)
+++ sandbox/conversion/libs/conversion_ext/test/intrinsec.cpp 2011-07-16 07:54:33 EDT (Sat, 16 Jul 2011)
@@ -91,8 +91,17 @@
template <> struct is_constructible< AA, A const& > : true_type {};
template <> struct is_constructible< CC, B const& > : true_type {};
template <> struct is_constructible< AE, B > : true_type {};
+
}
#endif
+
+#if defined BOOST_CONVERSION_NO_IS_EXPLICIT_CONVERTIBLE
+namespace boost
+{
+ template <> struct is_explicitly_convertible< X, ECF_X > : true_type {};
+}
+#endif
+
#if defined(BOOST_CONVERSION_NO_IS_ASSIGNABLE)
namespace boost
{
Modified: sandbox/conversion/libs/conversion_ext/test/is_constructible.cpp
==============================================================================
--- sandbox/conversion/libs/conversion_ext/test/is_constructible.cpp (original)
+++ sandbox/conversion/libs/conversion_ext/test/is_constructible.cpp 2011-07-16 07:54:33 EDT (Sat, 16 Jul 2011)
@@ -53,7 +53,6 @@
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));
- // BUG: We need to add specializations for void
BOOST_STATIC_ASSERT((!boost::is_constructible<void,A>::value));
BOOST_STATIC_ASSERT((boost::is_constructible<B>::value));
}
Modified: sandbox/conversion/libs/conversion_ext/test/is_copy_assignable.cpp
==============================================================================
--- sandbox/conversion/libs/conversion_ext/test/is_copy_assignable.cpp (original)
+++ sandbox/conversion/libs/conversion_ext/test/is_copy_assignable.cpp 2011-07-16 07:54:33 EDT (Sat, 16 Jul 2011)
@@ -53,9 +53,9 @@
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<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));
Modified: sandbox/conversion/libs/conversion_ext/test/is_explicitly_convertible.cpp
==============================================================================
--- sandbox/conversion/libs/conversion_ext/test/is_explicitly_convertible.cpp (original)
+++ sandbox/conversion/libs/conversion_ext/test/is_explicitly_convertible.cpp 2011-07-16 07:54:33 EDT (Sat, 16 Jul 2011)
@@ -8,7 +8,6 @@
//
//////////////////////////////////////////////////////////////////////////////
-
#include <iostream>
#include <boost/static_assert.hpp>
#include <boost/conversion/type_traits/is_explicitly_convertible.hpp>
@@ -24,8 +23,8 @@
#if defined(BOOST_CONVERSION_NO_IS_CONSTRUCTIBLE)
namespace boost
{
- template <> struct is_constructible< A, int > : true_type {};
- template <> struct is_constructible< A, double > : true_type {};
+ template <> struct is_explicitly_convertible< int, A > : true_type {};
+ template <> struct is_explicitly_convertible< double, A > : true_type {};
template <> struct is_constructible< A, int, double > : true_type {};
template <> struct is_constructible< A, A const& > : true_type {};
}
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