Boost logo

Boost-Commit :

Subject: [Boost-commit] svn:boost r80081 - trunk/libs/type_traits/test
From: mimomorin_at_[hidden]
Date: 2012-08-18 22:05:56


Author: michel
Date: 2012-08-18 22:05:55 EDT (Sat, 18 Aug 2012)
New Revision: 80081
URL: http://svn.boost.org/trac/boost/changeset/80081

Log:
Adding `is_convertible` test for function types
Text files modified:
   trunk/libs/type_traits/test/is_convertible_test.cpp | 10 ++++++++++
   1 files changed, 10 insertions(+), 0 deletions(-)

Modified: trunk/libs/type_traits/test/is_convertible_test.cpp
==============================================================================
--- trunk/libs/type_traits/test/is_convertible_test.cpp (original)
+++ trunk/libs/type_traits/test/is_convertible_test.cpp 2012-08-18 22:05:55 EDT (Sat, 18 Aug 2012)
@@ -115,6 +115,16 @@
 BOOST_CHECK_INTEGRAL_CONSTANT((::tt::is_convertible<int*, int[3]>::value), false);
 BOOST_CHECK_INTEGRAL_CONSTANT((::tt::is_convertible<test_abc3, const test_abc1&>::value), true);
 
+BOOST_CHECK_INTEGRAL_CONSTANT((::tt::is_convertible<int(), int()>::value), false);
+BOOST_CHECK_INTEGRAL_CONSTANT((::tt::is_convertible<int(), int(*)()>::value), true);
+BOOST_CHECK_INTEGRAL_CONSTANT((::tt::is_convertible<int(), int(* const)()>::value), true);
+BOOST_CHECK_INTEGRAL_CONSTANT((::tt::is_convertible<int(), int(* volatile)()>::value), true);
+BOOST_CHECK_INTEGRAL_CONSTANT((::tt::is_convertible<int(), int(* const volatile)()>::value), true);
+BOOST_CHECK_INTEGRAL_CONSTANT((::tt::is_convertible<int(), int(&)()>::value), true);
+#ifndef BOOST_NO_RVALUE_REFERENCES
+BOOST_CHECK_INTEGRAL_CONSTANT((::tt::is_convertible<int(), int(&&)()>::value), true);
+#endif
+
 BOOST_CHECK_INTEGRAL_CONSTANT((::tt::is_convertible<non_pointer, void*>::value), true);
 BOOST_CHECK_INTEGRAL_CONSTANT((::tt::is_convertible<non_pointer, int*>::value), false);
 BOOST_CHECK_INTEGRAL_CONSTANT((::tt::is_convertible<non_int_pointer, int*>::value), true);


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