Added new type traits tests.

[SVN r15974]
This commit is contained in:
John Maddock
2002-10-24 10:18:05 +00:00
parent 0ffcc1f82e
commit 1efa8a8319
66 changed files with 4585 additions and 1617 deletions

628
test/Jamfile Normal file
View File

@@ -0,0 +1,628 @@
subproject libs/type_traits/test ;
# bring in the rules for testing
SEARCH on testing.jam = $(BOOST_BUILD_PATH) ;
include testing.jam ;
{
local TYPE_TRAIT_PATH = "" ;
local TEST_LIB_PATH = "../../test/build/" ;
test-suite type_traits :
[ lib type_traits_init : $(TYPE_TRAIT_PATH)init.cpp
:
<sysinclude>$(BOOST_ROOT)
:
]
[ run $(TYPE_TRAIT_PATH)add_const_test.cpp
<lib>$(TYPE_TRAIT_PATH)type_traits_init
<lib>$(TEST_LIB_PATH)unit_test_framework
:
--report_level=detailed --build_info=yes --log_level=messages
:
:
<sysinclude>$(BOOST_ROOT)
:
]
[ run $(TYPE_TRAIT_PATH)add_pointer_test.cpp
<lib>$(TYPE_TRAIT_PATH)type_traits_init
<lib>$(TEST_LIB_PATH)unit_test_framework
:
--report_level=detailed --build_info=yes --log_level=messages
:
:
<sysinclude>$(BOOST_ROOT)
:
]
[ run $(TYPE_TRAIT_PATH)add_reference_test.cpp
<lib>$(TYPE_TRAIT_PATH)type_traits_init
<lib>$(TEST_LIB_PATH)unit_test_framework
:
--report_level=detailed --build_info=yes --log_level=messages
:
:
<sysinclude>$(BOOST_ROOT)
:
]
[ run $(TYPE_TRAIT_PATH)add_volatile_test.cpp
<lib>$(TYPE_TRAIT_PATH)type_traits_init
<lib>$(TEST_LIB_PATH)unit_test_framework
:
--report_level=detailed --build_info=yes --log_level=messages
:
:
<sysinclude>$(BOOST_ROOT)
:
]
[ run $(TYPE_TRAIT_PATH)alignment_of_test.cpp
<lib>$(TYPE_TRAIT_PATH)type_traits_init
<lib>$(TEST_LIB_PATH)unit_test_framework
:
--report_level=detailed --build_info=yes --log_level=messages
:
:
<sysinclude>$(BOOST_ROOT)
:
]
[ run $(TYPE_TRAIT_PATH)function_traits_test.cpp
<lib>$(TYPE_TRAIT_PATH)type_traits_init
<lib>$(TEST_LIB_PATH)unit_test_framework
:
--report_level=detailed --build_info=yes --log_level=messages
:
:
<sysinclude>$(BOOST_ROOT)
:
]
[ run $(TYPE_TRAIT_PATH)has_nothrow_assign_test.cpp
<lib>$(TYPE_TRAIT_PATH)type_traits_init
<lib>$(TEST_LIB_PATH)unit_test_framework
:
--report_level=detailed --build_info=yes --log_level=messages
:
:
<sysinclude>$(BOOST_ROOT)
:
]
[ run $(TYPE_TRAIT_PATH)has_nothrow_constructor_test.cpp
<lib>$(TYPE_TRAIT_PATH)type_traits_init
<lib>$(TEST_LIB_PATH)unit_test_framework
:
--report_level=detailed --build_info=yes --log_level=messages
:
:
<sysinclude>$(BOOST_ROOT)
:
]
[ run $(TYPE_TRAIT_PATH)has_nothrow_copy_test.cpp
<lib>$(TYPE_TRAIT_PATH)type_traits_init
<lib>$(TEST_LIB_PATH)unit_test_framework
:
--report_level=detailed --build_info=yes --log_level=messages
:
:
<sysinclude>$(BOOST_ROOT)
:
]
[ run $(TYPE_TRAIT_PATH)has_trivial_assign_test.cpp
<lib>$(TYPE_TRAIT_PATH)type_traits_init
<lib>$(TEST_LIB_PATH)unit_test_framework
:
--report_level=detailed --build_info=yes --log_level=messages
:
:
<sysinclude>$(BOOST_ROOT)
:
]
[ run $(TYPE_TRAIT_PATH)has_trivial_constructor_test.cpp
<lib>$(TYPE_TRAIT_PATH)type_traits_init
<lib>$(TEST_LIB_PATH)unit_test_framework
:
--report_level=detailed --build_info=yes --log_level=messages
:
:
<sysinclude>$(BOOST_ROOT)
:
]
[ run $(TYPE_TRAIT_PATH)has_trivial_copy_test.cpp
<lib>$(TYPE_TRAIT_PATH)type_traits_init
<lib>$(TEST_LIB_PATH)unit_test_framework
:
--report_level=detailed --build_info=yes --log_level=messages
:
:
<sysinclude>$(BOOST_ROOT)
:
]
[ run $(TYPE_TRAIT_PATH)has_trivial_destructor_test.cpp
<lib>$(TYPE_TRAIT_PATH)type_traits_init
<lib>$(TEST_LIB_PATH)unit_test_framework
:
--report_level=detailed --build_info=yes --log_level=messages
:
:
<sysinclude>$(BOOST_ROOT)
:
]
[ run $(TYPE_TRAIT_PATH)is_arithmetic_test.cpp
<lib>$(TYPE_TRAIT_PATH)type_traits_init
<lib>$(TEST_LIB_PATH)unit_test_framework
:
--report_level=detailed --build_info=yes --log_level=messages
:
:
<sysinclude>$(BOOST_ROOT)
:
]
[ run $(TYPE_TRAIT_PATH)is_array_test.cpp
<lib>$(TYPE_TRAIT_PATH)type_traits_init
<lib>$(TEST_LIB_PATH)unit_test_framework
:
--report_level=detailed --build_info=yes --log_level=messages
:
:
<sysinclude>$(BOOST_ROOT)
:
]
[ run $(TYPE_TRAIT_PATH)is_base_and_derived_test.cpp
<lib>$(TYPE_TRAIT_PATH)type_traits_init
<lib>$(TEST_LIB_PATH)unit_test_framework
:
--report_level=detailed --build_info=yes --log_level=messages
:
:
<sysinclude>$(BOOST_ROOT)
:
]
[ run $(TYPE_TRAIT_PATH)is_class_test.cpp
<lib>$(TYPE_TRAIT_PATH)type_traits_init
<lib>$(TEST_LIB_PATH)unit_test_framework
:
--report_level=detailed --build_info=yes --log_level=messages
:
:
<sysinclude>$(BOOST_ROOT)
:
]
[ run $(TYPE_TRAIT_PATH)is_compound_test.cpp
<lib>$(TYPE_TRAIT_PATH)type_traits_init
<lib>$(TEST_LIB_PATH)unit_test_framework
:
--report_level=detailed --build_info=yes --log_level=messages
:
:
<sysinclude>$(BOOST_ROOT)
:
]
[ run $(TYPE_TRAIT_PATH)is_const_test.cpp
<lib>$(TYPE_TRAIT_PATH)type_traits_init
<lib>$(TEST_LIB_PATH)unit_test_framework
:
--report_level=detailed --build_info=yes --log_level=messages
:
:
<sysinclude>$(BOOST_ROOT)
:
]
[ run $(TYPE_TRAIT_PATH)is_convertible_test.cpp
<lib>$(TYPE_TRAIT_PATH)type_traits_init
<lib>$(TEST_LIB_PATH)unit_test_framework
:
--report_level=detailed --build_info=yes --log_level=messages
:
:
<sysinclude>$(BOOST_ROOT)
:
]
[ run $(TYPE_TRAIT_PATH)is_empty_test.cpp
<lib>$(TYPE_TRAIT_PATH)type_traits_init
<lib>$(TEST_LIB_PATH)unit_test_framework
:
--report_level=detailed --build_info=yes --log_level=messages
:
:
<sysinclude>$(BOOST_ROOT)
:
]
[ run $(TYPE_TRAIT_PATH)is_enum_test.cpp
<lib>$(TYPE_TRAIT_PATH)type_traits_init
<lib>$(TEST_LIB_PATH)unit_test_framework
:
--report_level=detailed --build_info=yes --log_level=messages
:
:
<sysinclude>$(BOOST_ROOT)
:
]
[ run $(TYPE_TRAIT_PATH)is_float_test.cpp
<lib>$(TYPE_TRAIT_PATH)type_traits_init
<lib>$(TEST_LIB_PATH)unit_test_framework
:
--report_level=detailed --build_info=yes --log_level=messages
:
:
<sysinclude>$(BOOST_ROOT)
:
]
[ run $(TYPE_TRAIT_PATH)is_function_test.cpp
<lib>$(TYPE_TRAIT_PATH)type_traits_init
<lib>$(TEST_LIB_PATH)unit_test_framework
:
--report_level=detailed --build_info=yes --log_level=messages
:
:
<sysinclude>$(BOOST_ROOT)
:
]
[ run $(TYPE_TRAIT_PATH)is_fundamental_test.cpp
<lib>$(TYPE_TRAIT_PATH)type_traits_init
<lib>$(TEST_LIB_PATH)unit_test_framework
:
--report_level=detailed --build_info=yes --log_level=messages
:
:
<sysinclude>$(BOOST_ROOT)
:
]
[ run $(TYPE_TRAIT_PATH)is_integral_test.cpp
<lib>$(TYPE_TRAIT_PATH)type_traits_init
<lib>$(TEST_LIB_PATH)unit_test_framework
:
--report_level=detailed --build_info=yes --log_level=messages
:
:
<sysinclude>$(BOOST_ROOT)
:
]
[ run $(TYPE_TRAIT_PATH)is_member_function_pointer_test.cpp
<lib>$(TYPE_TRAIT_PATH)type_traits_init
<lib>$(TEST_LIB_PATH)unit_test_framework
:
--report_level=detailed --build_info=yes --log_level=messages
:
:
<sysinclude>$(BOOST_ROOT)
:
]
[ run $(TYPE_TRAIT_PATH)is_member_pointer_test.cpp
<lib>$(TYPE_TRAIT_PATH)type_traits_init
<lib>$(TEST_LIB_PATH)unit_test_framework
:
--report_level=detailed --build_info=yes --log_level=messages
:
:
<sysinclude>$(BOOST_ROOT)
:
]
[ run $(TYPE_TRAIT_PATH)is_object_test.cpp
<lib>$(TYPE_TRAIT_PATH)type_traits_init
<lib>$(TEST_LIB_PATH)unit_test_framework
:
--report_level=detailed --build_info=yes --log_level=messages
:
:
<sysinclude>$(BOOST_ROOT)
:
]
[ run $(TYPE_TRAIT_PATH)is_pod_test.cpp
<lib>$(TYPE_TRAIT_PATH)type_traits_init
<lib>$(TEST_LIB_PATH)unit_test_framework
:
--report_level=detailed --build_info=yes --log_level=messages
:
:
<sysinclude>$(BOOST_ROOT)
:
]
[ run $(TYPE_TRAIT_PATH)is_pointer_test.cpp
<lib>$(TYPE_TRAIT_PATH)type_traits_init
<lib>$(TEST_LIB_PATH)unit_test_framework
:
--report_level=detailed --build_info=yes --log_level=messages
:
:
<sysinclude>$(BOOST_ROOT)
:
]
[ run $(TYPE_TRAIT_PATH)is_reference_test.cpp
<lib>$(TYPE_TRAIT_PATH)type_traits_init
<lib>$(TEST_LIB_PATH)unit_test_framework
:
--report_level=detailed --build_info=yes --log_level=messages
:
:
<sysinclude>$(BOOST_ROOT)
:
]
[ run $(TYPE_TRAIT_PATH)is_same_test.cpp
<lib>$(TYPE_TRAIT_PATH)type_traits_init
<lib>$(TEST_LIB_PATH)unit_test_framework
:
--report_level=detailed --build_info=yes --log_level=messages
:
:
<sysinclude>$(BOOST_ROOT)
:
]
[ run $(TYPE_TRAIT_PATH)is_scalar_test.cpp
<lib>$(TYPE_TRAIT_PATH)type_traits_init
<lib>$(TEST_LIB_PATH)unit_test_framework
:
--report_level=detailed --build_info=yes --log_level=messages
:
:
<sysinclude>$(BOOST_ROOT)
:
]
[ run $(TYPE_TRAIT_PATH)is_union_test.cpp
<lib>$(TYPE_TRAIT_PATH)type_traits_init
<lib>$(TEST_LIB_PATH)unit_test_framework
:
--report_level=detailed --build_info=yes --log_level=messages
:
:
<sysinclude>$(BOOST_ROOT)
:
]
[ run $(TYPE_TRAIT_PATH)is_void_test.cpp
<lib>$(TYPE_TRAIT_PATH)type_traits_init
<lib>$(TEST_LIB_PATH)unit_test_framework
:
--report_level=detailed --build_info=yes --log_level=messages
:
:
<sysinclude>$(BOOST_ROOT)
:
]
[ run $(TYPE_TRAIT_PATH)is_volatile_test.cpp
<lib>$(TYPE_TRAIT_PATH)type_traits_init
<lib>$(TEST_LIB_PATH)unit_test_framework
:
--report_level=detailed --build_info=yes --log_level=messages
:
:
<sysinclude>$(BOOST_ROOT)
:
]
[ run $(TYPE_TRAIT_PATH)remove_bounds_test.cpp
<lib>$(TYPE_TRAIT_PATH)type_traits_init
<lib>$(TEST_LIB_PATH)unit_test_framework
:
--report_level=detailed --build_info=yes --log_level=messages
:
:
<sysinclude>$(BOOST_ROOT)
:
]
[ run $(TYPE_TRAIT_PATH)remove_const_test.cpp
<lib>$(TYPE_TRAIT_PATH)type_traits_init
<lib>$(TEST_LIB_PATH)unit_test_framework
:
--report_level=detailed --build_info=yes --log_level=messages
:
:
<sysinclude>$(BOOST_ROOT)
:
]
[ run $(TYPE_TRAIT_PATH)remove_cv_test.cpp
<lib>$(TYPE_TRAIT_PATH)type_traits_init
<lib>$(TEST_LIB_PATH)unit_test_framework
:
--report_level=detailed --build_info=yes --log_level=messages
:
:
<sysinclude>$(BOOST_ROOT)
:
]
[ run $(TYPE_TRAIT_PATH)remove_pointer_test.cpp
<lib>$(TYPE_TRAIT_PATH)type_traits_init
<lib>$(TEST_LIB_PATH)unit_test_framework
:
--report_level=detailed --build_info=yes --log_level=messages
:
:
<sysinclude>$(BOOST_ROOT)
:
]
[ run $(TYPE_TRAIT_PATH)remove_reference_test.cpp
<lib>$(TYPE_TRAIT_PATH)type_traits_init
<lib>$(TEST_LIB_PATH)unit_test_framework
:
--report_level=detailed --build_info=yes --log_level=messages
:
:
<sysinclude>$(BOOST_ROOT)
:
]
[ run $(TYPE_TRAIT_PATH)remove_volatile_test.cpp
<lib>$(TYPE_TRAIT_PATH)type_traits_init
<lib>$(TEST_LIB_PATH)unit_test_framework
:
--report_level=detailed --build_info=yes --log_level=messages
:
:
<sysinclude>$(BOOST_ROOT)
:
]
[ run $(TYPE_TRAIT_PATH)tricky_abstract_type_test.cpp
<lib>$(TYPE_TRAIT_PATH)type_traits_init
<lib>$(TEST_LIB_PATH)unit_test_framework
:
--report_level=detailed --build_info=yes --log_level=messages
:
:
<sysinclude>$(BOOST_ROOT)
:
]
[ run $(TYPE_TRAIT_PATH)tricky_add_pointer_test.cpp
<lib>$(TYPE_TRAIT_PATH)type_traits_init
<lib>$(TEST_LIB_PATH)unit_test_framework
:
--report_level=detailed --build_info=yes --log_level=messages
:
:
<sysinclude>$(BOOST_ROOT)
:
]
[ run $(TYPE_TRAIT_PATH)tricky_function_type_test.cpp
<lib>$(TYPE_TRAIT_PATH)type_traits_init
<lib>$(TEST_LIB_PATH)unit_test_framework
:
--report_level=detailed --build_info=yes --log_level=messages
:
:
<sysinclude>$(BOOST_ROOT)
:
]
[ run $(TYPE_TRAIT_PATH)tricky_incomplete_type_test.cpp
<lib>$(TYPE_TRAIT_PATH)type_traits_init
<lib>$(TEST_LIB_PATH)unit_test_framework
:
--report_level=detailed --build_info=yes --log_level=messages
:
:
<sysinclude>$(BOOST_ROOT)
:
]
[ run $(TYPE_TRAIT_PATH)tricky_partial_specialization_test.cpp
<lib>$(TYPE_TRAIT_PATH)type_traits_init
<lib>$(TEST_LIB_PATH)unit_test_framework
:
--report_level=detailed --build_info=yes --log_level=messages
:
:
<sysinclude>$(BOOST_ROOT)
:
]
[ run $(TYPE_TRAIT_PATH)type_with_alignment_test.cpp
<lib>$(TYPE_TRAIT_PATH)type_traits_init
<lib>$(TEST_LIB_PATH)unit_test_framework
:
--report_level=detailed --build_info=yes --log_level=messages
:
:
<sysinclude>$(BOOST_ROOT)
:
]
[ run $(TYPE_TRAIT_PATH)type_with_alignment_test.cpp $(TYPE_TRAIT_PATH)tricky_partial_specialization_test.cpp $(TYPE_TRAIT_PATH)tricky_incomplete_type_test.cpp $(TYPE_TRAIT_PATH)tricky_function_type_test.cpp $(TYPE_TRAIT_PATH)tricky_add_pointer_test.cpp $(TYPE_TRAIT_PATH)tricky_abstract_type_test.cpp $(TYPE_TRAIT_PATH)remove_volatile_test.cpp $(TYPE_TRAIT_PATH)remove_reference_test.cpp $(TYPE_TRAIT_PATH)remove_pointer_test.cpp $(TYPE_TRAIT_PATH)remove_cv_test.cpp $(TYPE_TRAIT_PATH)remove_const_test.cpp $(TYPE_TRAIT_PATH)remove_bounds_test.cpp $(TYPE_TRAIT_PATH)is_volatile_test.cpp $(TYPE_TRAIT_PATH)is_void_test.cpp $(TYPE_TRAIT_PATH)is_union_test.cpp $(TYPE_TRAIT_PATH)is_scalar_test.cpp $(TYPE_TRAIT_PATH)is_same_test.cpp $(TYPE_TRAIT_PATH)is_reference_test.cpp $(TYPE_TRAIT_PATH)is_pointer_test.cpp $(TYPE_TRAIT_PATH)is_pod_test.cpp $(TYPE_TRAIT_PATH)is_object_test.cpp $(TYPE_TRAIT_PATH)is_member_pointer_test.cpp $(TYPE_TRAIT_PATH)is_member_function_pointer_test.cpp $(TYPE_TRAIT_PATH)is_integral_test.cpp $(TYPE_TRAIT_PATH)is_fundamental_test.cpp $(TYPE_TRAIT_PATH)is_function_test.cpp $(TYPE_TRAIT_PATH)is_float_test.cpp $(TYPE_TRAIT_PATH)is_enum_test.cpp $(TYPE_TRAIT_PATH)is_empty_test.cpp $(TYPE_TRAIT_PATH)is_convertible_test.cpp $(TYPE_TRAIT_PATH)is_const_test.cpp $(TYPE_TRAIT_PATH)is_compound_test.cpp $(TYPE_TRAIT_PATH)is_class_test.cpp $(TYPE_TRAIT_PATH)is_base_and_derived_test.cpp $(TYPE_TRAIT_PATH)is_array_test.cpp $(TYPE_TRAIT_PATH)is_arithmetic_test.cpp $(TYPE_TRAIT_PATH)has_trivial_destructor_test.cpp $(TYPE_TRAIT_PATH)has_trivial_copy_test.cpp $(TYPE_TRAIT_PATH)has_trivial_constructor_test.cpp $(TYPE_TRAIT_PATH)has_trivial_assign_test.cpp $(TYPE_TRAIT_PATH)has_nothrow_copy_test.cpp $(TYPE_TRAIT_PATH)has_nothrow_constructor_test.cpp $(TYPE_TRAIT_PATH)has_nothrow_assign_test.cpp $(TYPE_TRAIT_PATH)function_traits_test.cpp $(TYPE_TRAIT_PATH)alignment_of_test.cpp $(TYPE_TRAIT_PATH)add_volatile_test.cpp $(TYPE_TRAIT_PATH)add_reference_test.cpp $(TYPE_TRAIT_PATH)add_pointer_test.cpp $(TYPE_TRAIT_PATH)add_const_test.cpp
<lib>$(TYPE_TRAIT_PATH)type_traits_init
<lib>$(TEST_LIB_PATH)unit_test_framework
:
--report_level=detailed --build_info=yes --log_level=messages
:
:
<sysinclude>$(BOOST_ROOT)
:
type_traits_tests
]
;
}

42
test/add_const_test.cpp Normal file
View File

@@ -0,0 +1,42 @@
#include "test.hpp"
#include "check_type.hpp"
#include TYPE_TRANSFORM(add_const)
BOOST_DECL_TRANSFORM_TEST(add_const_test_1, ::boost::add_const, const, const)
BOOST_DECL_TRANSFORM_TEST(add_const_test_2, ::boost::add_const, volatile, volatile const)
BOOST_DECL_TRANSFORM_TEST(add_const_test_3, ::boost::add_const, *, *const)
BOOST_DECL_TRANSFORM_TEST2(add_const_test_4, ::boost::add_const, const)
BOOST_DECL_TRANSFORM_TEST(add_const_test_7, ::boost::add_const, *volatile, *volatile const)
BOOST_DECL_TRANSFORM_TEST(add_const_test_10, ::boost::add_const, const*, const*const)
BOOST_DECL_TRANSFORM_TEST(add_const_test_11, ::boost::add_const, volatile*, volatile*const)
BOOST_DECL_TRANSFORM_TEST(add_const_test_5, ::boost::add_const, const &, const&)
BOOST_DECL_TRANSFORM_TEST(add_const_test_6, ::boost::add_const, &, &)
BOOST_DECL_TRANSFORM_TEST(add_const_test_8, ::boost::add_const, const [2], const [2])
BOOST_DECL_TRANSFORM_TEST(add_const_test_9, ::boost::add_const, volatile &, volatile&)
BOOST_DECL_TRANSFORM_TEST(add_const_test_12, ::boost::add_const, [2][3], const[2][3])
BOOST_DECL_TRANSFORM_TEST(add_const_test_13, ::boost::add_const, (&)[2], (&)[2])
TT_TEST_BEGIN(add_const)
add_const_test_1();
add_const_test_2();
add_const_test_3();
add_const_test_4();
add_const_test_7();
add_const_test_10();
add_const_test_11();
add_const_test_5();
add_const_test_6();
add_const_test_8();
add_const_test_9();
add_const_test_12();
add_const_test_13();
TT_TEST_END

30
test/add_pointer_test.cpp Normal file
View File

@@ -0,0 +1,30 @@
#include "test.hpp"
#include "check_type.hpp"
#include TYPE_TRANSFORM(add_pointer)
BOOST_DECL_TRANSFORM_TEST(add_pointer_test_1, ::boost::add_pointer, const, const*)
BOOST_DECL_TRANSFORM_TEST(add_pointer_test_2, ::boost::add_pointer, volatile, volatile*)
BOOST_DECL_TRANSFORM_TEST(add_pointer_test_3, ::boost::add_pointer, *, **)
BOOST_DECL_TRANSFORM_TEST2(add_pointer_test_4, ::boost::add_pointer, *)
BOOST_DECL_TRANSFORM_TEST(add_pointer_test_7, ::boost::add_pointer, *volatile, *volatile*)
BOOST_DECL_TRANSFORM_TEST(add_pointer_test_10, ::boost::add_pointer, const*, const**)
BOOST_DECL_TRANSFORM_TEST(add_pointer_test_11, ::boost::add_pointer, volatile*, volatile**)
TT_TEST_BEGIN(add_pointer)
add_pointer_test_1();
add_pointer_test_2();
add_pointer_test_3();
add_pointer_test_4();
add_pointer_test_7();
add_pointer_test_10();
add_pointer_test_11();
TT_TEST_END

View File

@@ -0,0 +1,42 @@
#include "test.hpp"
#include "check_type.hpp"
#include TYPE_TRANSFORM(add_reference)
BOOST_DECL_TRANSFORM_TEST(add_reference_test_1, ::boost::add_reference, const, const&)
BOOST_DECL_TRANSFORM_TEST(add_reference_test_2, ::boost::add_reference, volatile, volatile&)
BOOST_DECL_TRANSFORM_TEST(add_reference_test_3, ::boost::add_reference, *, *&)
BOOST_DECL_TRANSFORM_TEST2(add_reference_test_4, ::boost::add_reference, &)
BOOST_DECL_TRANSFORM_TEST(add_reference_test_5, ::boost::add_reference, const &, const&)
BOOST_DECL_TRANSFORM_TEST(add_reference_test_6, ::boost::add_reference, &, &)
BOOST_DECL_TRANSFORM_TEST(add_reference_test_7, ::boost::add_reference, *volatile, *volatile&)
BOOST_DECL_TRANSFORM_TEST(add_reference_test_8, ::boost::add_reference, const [2], const (&)[2])
BOOST_DECL_TRANSFORM_TEST(add_reference_test_9, ::boost::add_reference, const &, const&)
BOOST_DECL_TRANSFORM_TEST(add_reference_test_10, ::boost::add_reference, const*, const*&)
BOOST_DECL_TRANSFORM_TEST(add_reference_test_11, ::boost::add_reference, volatile*, volatile*&)
BOOST_DECL_TRANSFORM_TEST(add_reference_test_12, ::boost::add_reference, const[2][3], const (&)[2][3])
BOOST_DECL_TRANSFORM_TEST(add_reference_test_13, ::boost::add_reference, (&)[2], (&)[2])
TT_TEST_BEGIN(add_reference)
add_reference_test_1();
add_reference_test_2();
add_reference_test_3();
add_reference_test_4();
add_reference_test_5();
add_reference_test_6();
add_reference_test_7();
add_reference_test_8();
add_reference_test_9();
add_reference_test_10();
add_reference_test_11();
add_reference_test_12();
add_reference_test_13();
TT_TEST_END

View File

@@ -0,0 +1,42 @@
#include "test.hpp"
#include "check_type.hpp"
#include TYPE_TRANSFORM(add_volatile)
BOOST_DECL_TRANSFORM_TEST(add_volatile_test_1, ::boost::add_volatile, const, const volatile)
BOOST_DECL_TRANSFORM_TEST(add_volatile_test_2, ::boost::add_volatile, volatile, volatile)
BOOST_DECL_TRANSFORM_TEST(add_volatile_test_3, ::boost::add_volatile, *, *volatile)
BOOST_DECL_TRANSFORM_TEST2(add_volatile_test_4, ::boost::add_volatile, volatile)
BOOST_DECL_TRANSFORM_TEST(add_volatile_test_7, ::boost::add_volatile, *volatile, *volatile)
BOOST_DECL_TRANSFORM_TEST(add_volatile_test_10, ::boost::add_volatile, const*, const*volatile)
BOOST_DECL_TRANSFORM_TEST(add_volatile_test_11, ::boost::add_volatile, volatile*, volatile*volatile)
BOOST_DECL_TRANSFORM_TEST(add_volatile_test_5, ::boost::add_volatile, const &, const&)
BOOST_DECL_TRANSFORM_TEST(add_volatile_test_6, ::boost::add_volatile, &, &)
BOOST_DECL_TRANSFORM_TEST(add_volatile_test_8, ::boost::add_volatile, const [2], const volatile [2])
BOOST_DECL_TRANSFORM_TEST(add_volatile_test_9, ::boost::add_volatile, volatile &, volatile&)
BOOST_DECL_TRANSFORM_TEST(add_volatile_test_12, ::boost::add_volatile, [2][3], volatile[2][3])
BOOST_DECL_TRANSFORM_TEST(add_volatile_test_13, ::boost::add_volatile, (&)[2], (&)[2])
TT_TEST_BEGIN(add_volatile)
add_volatile_test_1();
add_volatile_test_2();
add_volatile_test_3();
add_volatile_test_4();
add_volatile_test_7();
add_volatile_test_10();
add_volatile_test_11();
add_volatile_test_5();
add_volatile_test_6();
add_volatile_test_8();
add_volatile_test_9();
add_volatile_test_12();
add_volatile_test_13();
TT_TEST_END

View File

@@ -0,0 +1,60 @@
#include "test.hpp"
#include "check_integral_constant.hpp"
#include TYPE_TRAITS(alignment_of)
//
// VC++ emits an awful lot of warnings unless we define these:
#ifdef BOOST_MSVC
# pragma warning(disable:4244)
#endif
template <class T>
struct align_calc
{
char padding;
T instance;
static std::ptrdiff_t get()
{
static align_calc<T> a;
return reinterpret_cast<const char*>(&(a.instance)) - reinterpret_cast<const char*>(&(a.padding));
}
};
#define ALIGNOF(x) align_calc<x>::get()
TT_TEST_BEGIN(alignment_of)
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::alignment_of<void>::value, 0);
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::alignment_of<char>::value, ALIGNOF(char));
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::alignment_of<short>::value, ALIGNOF(short));
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::alignment_of<int>::value, ALIGNOF(int));
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::alignment_of<long>::value, ALIGNOF(long));
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::alignment_of<float>::value, ALIGNOF(float));
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::alignment_of<double>::value, ALIGNOF(double));
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::alignment_of<long double>::value, ALIGNOF(long double));
#ifdef BOOST_HAS_LONG_LONG
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::alignment_of<long long>::value, ALIGNOF(long long));
#endif
#ifdef BOOST_HAS_MS_INT64
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::alignment_of<__int64>::value, ALIGNOF(__int64));
#endif
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::alignment_of<int[4]>::value, ALIGNOF(int[4]));
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::alignment_of<int(*)(int)>::value, ALIGNOF(int(*)(int)));
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::alignment_of<int*>::value, ALIGNOF(int*));
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::alignment_of<VB>::value, ALIGNOF(VB));
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::alignment_of<VD>::value, ALIGNOF(VD));
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::alignment_of<enum_UDT>::value, ALIGNOF(enum_UDT));
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::alignment_of<mf2>::value, ALIGNOF(mf2));
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::alignment_of<POD_UDT>::value, ALIGNOF(POD_UDT));
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::alignment_of<empty_UDT>::value, ALIGNOF(empty_UDT));
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::alignment_of<union_UDT>::value, ALIGNOF(union_UDT));
TT_TEST_END

View File

@@ -0,0 +1,63 @@
#ifndef BOOST_CHECK_INTEGRAL_CONSTANT_HPP
#define BOOST_CHECK_INTEGRAL_CONSTANT_HPP
#include <boost/test/test_tools.hpp>
namespace boost{
namespace detail{
/*
macro:
BOOST_CHECK_INTEGRAL_CONSTANT(expression, expected_value)
expression: an integral constant expression to check.
expected_value: the value expected.
*/
template <long test_value>
struct integral_constant
{
static long value() { return test_value; }
};
template <class T, class U>
bool tt_compare(T found, U expected)
{ return static_cast<U>(found) == expected; }
#define BOOST_CHECK_INTEGRAL_CONSTANT(expression, expected_value)\
if(!::boost::detail::tt_compare(::boost::detail::integral_constant<(expression)>::value(), expression)){\
BOOST_CHECK_MESSAGE(false, "The expression: \"" << BOOST_STRINGIZE(expression) << "\" had differing values depending upon whether it was used as an integral constant expression or not");\
}else{\
BOOST_CHECK_MESSAGE(true, "Validating Integral Constant Expression: \"" << BOOST_STRINGIZE(expression) << "\"");\
}\
if(!::boost::detail::tt_compare(expression, expected_value))\
BOOST_CHECK_MESSAGE(false, "The expression: \"" << BOOST_STRINGIZE(expression) << "\" had an invalid value (found " << ::boost::detail::integral_constant<(expression)>::value() << ", expected " << expected_value << ")" )
/*
macro:
BOOST_CHECK_SOFT_INTEGRAL_CONSTANT(expression, expected_value, alternate_value)
expression: an integral constant expression to check.
expected_value: the value expected.
alternate_value: an alternative value that results is a warning not a failure if found.
*/
#define BOOST_CHECK_SOFT_INTEGRAL_CONSTANT(expression, expected_value, alternate_value)\
if(!::boost::detail::tt_compare(::boost::detail::integral_constant<(expression)>::value(), expression)){\
BOOST_CHECK_MESSAGE(false, "The expression: \"" << BOOST_STRINGIZE(expression) << "\" had differing values depending upon whether it was used as an integral constant expression or not");\
}else{\
BOOST_CHECK_MESSAGE(true, "Validating Integral Constant Expression: \"" << BOOST_STRINGIZE(expression) << "\"");\
}\
if(!::boost::detail::tt_compare(expression, expected_value))\
if(!::boost::detail::tt_compare(expression, alternate_value))\
BOOST_CHECK_MESSAGE(false, "The expression: \"" << BOOST_STRINGIZE(expression) << "\" had an invalid value (found " << ::boost::detail::integral_constant<(expression)>::value() << ", expected " << expected_value << ")" );\
else\
BOOST_WARN_MESSAGE(false, "The expression: \"" << BOOST_STRINGIZE(expression) << "\" did not have the value we wish it to have (found " << ::boost::detail::integral_constant<(expression)>::value() << ", expected " << expected_value << ")" )
}//detail
}//boost
#endif

34
test/check_type.hpp Normal file
View File

@@ -0,0 +1,34 @@
#ifndef BOOST_CHECK_TYPE_HPP
#define BOOST_CHECK_TYPE_HPP
#include <boost/test/test_tools.hpp>
#include <boost/type_traits/is_same.hpp>
/*
macro:
BOOST_CHECK_TYPE(type_expression, expected_type)
type_expression: an expression that evaluates to a typename.
expected_value: the type we expect to find.
*/
#ifdef __BORLANDC__
#pragma option -w-8008 -w-8066 -w-8019
#endif
#define BOOST_CHECK_TYPE(type_expression, expected_type)\
do{\
if(!::boost::is_same<type_expression, expected_type>::value){\
BOOST_CHECK_MESSAGE(false, "The expression: \"" << BOOST_STRINGIZE(expression)\
<< "\" did not have the expected type:\n\tevaluating: boost::is_same<"\
<< BOOST_STRINGIZE(type_expression) << ", " << BOOST_STRINGIZE(expected_type)\
<< ">" << "\n\tfound: "\
<< typeid(::boost::is_same<type_expression, expected_type>).name());\
}else\
BOOST_CHECK_MESSAGE(true, "Validating Type Expression: \""\
<< BOOST_STRINGIZE(expression) << "\"");\
}while(0)
#endif

88
test/create_jamfile Normal file
View File

@@ -0,0 +1,88 @@
#!/bin/sh
#
# shell script to create a Jamfile for all the tests:
#
all_source=""
#start Jamfile:
cat > Jamfile << EOF
subproject libs/type_traits/test ;
# bring in the rules for testing
SEARCH on testing.jam = \$(BOOST_BUILD_PATH) ;
include testing.jam ;
{
local TYPE_TRAIT_PATH = "" ;
local TEST_LIB_PATH = "../../test/build/" ;
EOF
for file in *.cpp ; do
if [ $file != init.cpp ] ; then
if [ $file != template.cpp ] ; then
if [ a"$all_source" != "a" ] ; then
all_source="\$(TYPE_TRAIT_PATH)$file $all_source"
else
all_source="\$(TYPE_TRAIT_PATH)$file"
fi
cat >> Jamfile_temp << EOF
[ run \$(TYPE_TRAIT_PATH)$file
<lib>\$(TYPE_TRAIT_PATH)type_traits_init
<lib>\$(TEST_LIB_PATH)unit_test_framework
:
--report_level=detailed --build_info=yes --log_level=messages
:
:
<sysinclude>\$(BOOST_ROOT)
:
]
EOF
fi
fi
done
# finish off Jamfile:
cat >> Jamfile << EOF
test-suite type_traits :
[ lib type_traits_init : \$(TYPE_TRAIT_PATH)init.cpp
:
<sysinclude>\$(BOOST_ROOT)
:
]
$(cat Jamfile_temp)
[ run $all_source
<lib>\$(TYPE_TRAIT_PATH)type_traits_init
<lib>\$(TEST_LIB_PATH)unit_test_framework
:
--report_level=detailed --build_info=yes --log_level=messages
:
:
<sysinclude>\$(BOOST_ROOT)
:
type_traits_tests
]
;
}
EOF
rm Jamfile_temp

View File

@@ -0,0 +1,57 @@
#include "test.hpp"
#include "check_type.hpp"
#include "check_integral_constant.hpp"
#include TYPE_TRAITS(function_traits)
typedef void(pf_zero1)();
typedef int(pf_zero2)();
typedef const int& (pf_zero3)();
typedef void(pf_one1)(int);
typedef int(pf_one2)(int);
typedef const int&(pf_one3)(const int&);
typedef void(pf_two1)(int,int);
typedef int(pf_two2)(int,int);
typedef const int&(pf_two3)(const int&,const int&);
TT_TEST_BEGIN(function_traits)
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::function_traits<pf_zero1>::arity, 0);
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::function_traits<pf_zero2>::arity, 0);
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::function_traits<pf_zero3>::arity, 0);
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::function_traits<pf_one1>::arity, 1);
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::function_traits<pf_one2>::arity, 1);
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::function_traits<pf_one3>::arity, 1);
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::function_traits<pf_two1>::arity, 2);
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::function_traits<pf_two2>::arity, 2);
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::function_traits<pf_two3>::arity, 2);
BOOST_CHECK_TYPE(void, ::tt::function_traits<pf_zero1>::result_type);
BOOST_CHECK_TYPE(::tt::function_traits<pf_zero2>::result_type, int);
BOOST_CHECK_TYPE(::tt::function_traits<pf_zero3>::result_type, const int&);
BOOST_CHECK_TYPE(::tt::function_traits<pf_one1>::result_type, void);
BOOST_CHECK_TYPE(::tt::function_traits<pf_one2>::result_type, int);
BOOST_CHECK_TYPE(::tt::function_traits<pf_one3>::result_type, const int&);
BOOST_CHECK_TYPE(::tt::function_traits<pf_two1>::result_type, void);
BOOST_CHECK_TYPE(::tt::function_traits<pf_two2>::result_type, int);
BOOST_CHECK_TYPE(::tt::function_traits<pf_two3>::result_type, const int&);
BOOST_CHECK_TYPE(::tt::function_traits<pf_one1>::arg1_type, int);
BOOST_CHECK_TYPE(::tt::function_traits<pf_one2>::arg1_type, int);
BOOST_CHECK_TYPE(::tt::function_traits<pf_one3>::arg1_type, const int&);
BOOST_CHECK_TYPE(::tt::function_traits<pf_two1>::arg1_type, int);
BOOST_CHECK_TYPE(::tt::function_traits<pf_two2>::arg1_type, int);
BOOST_CHECK_TYPE(::tt::function_traits<pf_two3>::arg1_type, const int&);
BOOST_CHECK_TYPE(::tt::function_traits<pf_two1>::arg2_type, int);
BOOST_CHECK_TYPE(::tt::function_traits<pf_two2>::arg2_type, int);
BOOST_CHECK_TYPE(::tt::function_traits<pf_two3>::arg2_type, const int&);
TT_TEST_END

View File

@@ -0,0 +1,149 @@
#include "test.hpp"
#include "check_integral_constant.hpp"
#include TYPE_TRAITS(has_nothrow_assign)
TT_TEST_BEGIN(has_nothrow_assign)
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_nothrow_assign<bool>::value, true);
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_nothrow_assign<bool const>::value, false);
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_nothrow_assign<bool volatile>::value, false);
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_nothrow_assign<bool const volatile>::value, false);
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_nothrow_assign<signed char>::value, true);
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_nothrow_assign<signed char const>::value, false);
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_nothrow_assign<signed char volatile>::value, false);
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_nothrow_assign<signed char const volatile>::value, false);
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_nothrow_assign<unsigned char>::value, true);
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_nothrow_assign<char>::value, true);
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_nothrow_assign<unsigned char const>::value, false);
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_nothrow_assign<char const>::value, false);
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_nothrow_assign<unsigned char volatile>::value, false);
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_nothrow_assign<char volatile>::value, false);
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_nothrow_assign<unsigned char const volatile>::value, false);
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_nothrow_assign<char const volatile>::value, false);
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_nothrow_assign<unsigned short>::value, true);
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_nothrow_assign<short>::value, true);
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_nothrow_assign<unsigned short const>::value, false);
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_nothrow_assign<short const>::value, false);
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_nothrow_assign<unsigned short volatile>::value, false);
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_nothrow_assign<short volatile>::value, false);
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_nothrow_assign<unsigned short const volatile>::value, false);
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_nothrow_assign<short const volatile>::value, false);
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_nothrow_assign<unsigned int>::value, true);
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_nothrow_assign<int>::value, true);
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_nothrow_assign<unsigned int const>::value, false);
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_nothrow_assign<int const>::value, false);
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_nothrow_assign<unsigned int volatile>::value, false);
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_nothrow_assign<int volatile>::value, false);
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_nothrow_assign<unsigned int const volatile>::value, false);
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_nothrow_assign<int const volatile>::value, false);
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_nothrow_assign<unsigned long>::value, true);
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_nothrow_assign<long>::value, true);
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_nothrow_assign<unsigned long const>::value, false);
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_nothrow_assign<long const>::value, false);
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_nothrow_assign<unsigned long volatile>::value, false);
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_nothrow_assign<long volatile>::value, false);
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_nothrow_assign<unsigned long const volatile>::value, false);
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_nothrow_assign<long const volatile>::value, false);
#ifdef BOOST_HAS_LONG_LONG
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_nothrow_assign<unsigned long long>::value, true);
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_nothrow_assign<long long>::value, true);
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_nothrow_assign<unsigned long long const>::value, false);
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_nothrow_assign<long long const>::value, false);
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_nothrow_assign<unsigned long long volatile>::value, false);
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_nothrow_assign<long long volatile>::value, false);
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_nothrow_assign<unsigned long long const volatile>::value, false);
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_nothrow_assign<long long const volatile>::value, false);
#endif
#ifdef BOOST_HAS_MS_INT64
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_nothrow_assign<unsigned __int8>::value, true);
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_nothrow_assign<__int8>::value, true);
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_nothrow_assign<unsigned __int8 const>::value, false);
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_nothrow_assign<__int8 const>::value, false);
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_nothrow_assign<unsigned __int8 volatile>::value, false);
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_nothrow_assign<__int8 volatile>::value, false);
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_nothrow_assign<unsigned __int8 const volatile>::value, false);
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_nothrow_assign<__int8 const volatile>::value, false);
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_nothrow_assign<unsigned __int16>::value, true);
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_nothrow_assign<__int16>::value, true);
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_nothrow_assign<unsigned __int16 const>::value, false);
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_nothrow_assign<__int16 const>::value, false);
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_nothrow_assign<unsigned __int16 volatile>::value, false);
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_nothrow_assign<__int16 volatile>::value, false);
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_nothrow_assign<unsigned __int16 const volatile>::value, false);
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_nothrow_assign<__int16 const volatile>::value, false);
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_nothrow_assign<unsigned __int32>::value, true);
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_nothrow_assign<__int32>::value, true);
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_nothrow_assign<unsigned __int32 const>::value, false);
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_nothrow_assign<__int32 const>::value, false);
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_nothrow_assign<unsigned __int32 volatile>::value, false);
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_nothrow_assign<__int32 volatile>::value, false);
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_nothrow_assign<unsigned __int32 const volatile>::value, false);
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_nothrow_assign<__int32 const volatile>::value, false);
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_nothrow_assign<unsigned __int64>::value, true);
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_nothrow_assign<__int64>::value, true);
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_nothrow_assign<unsigned __int64 const>::value, false);
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_nothrow_assign<__int64 const>::value, false);
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_nothrow_assign<unsigned __int64 volatile>::value, false);
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_nothrow_assign<__int64 volatile>::value, false);
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_nothrow_assign<unsigned __int64 const volatile>::value, false);
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_nothrow_assign<__int64 const volatile>::value, false);
#endif
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_nothrow_assign<float>::value, true);
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_nothrow_assign<float const>::value, false);
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_nothrow_assign<float volatile>::value, false);
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_nothrow_assign<float const volatile>::value, false);
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_nothrow_assign<double>::value, true);
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_nothrow_assign<double const>::value, false);
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_nothrow_assign<double volatile>::value, false);
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_nothrow_assign<double const volatile>::value, false);
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_nothrow_assign<long double>::value, true);
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_nothrow_assign<long double const>::value, false);
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_nothrow_assign<long double volatile>::value, false);
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_nothrow_assign<long double const volatile>::value, false);
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_nothrow_assign<int>::value, true);
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_nothrow_assign<void*>::value, true);
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_nothrow_assign<int*const>::value, false);
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_nothrow_assign<f1>::value, true);
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_nothrow_assign<f2>::value, true);
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_nothrow_assign<f3>::value, true);
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_nothrow_assign<mf1>::value, true);
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_nothrow_assign<mf2>::value, true);
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_nothrow_assign<mf3>::value, true);
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_nothrow_assign<mp>::value, true);
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_nothrow_assign<cmf>::value, true);
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_nothrow_assign<enum_UDT>::value, true);
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_nothrow_assign<int&>::value, false);
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_nothrow_assign<const int&>::value, false);
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_nothrow_assign<int[2]>::value, true);
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_nothrow_assign<int[3][2]>::value, true);
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_nothrow_assign<int[2][4][5][6][3]>::value, true);
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_nothrow_assign<UDT>::value, false);
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_nothrow_assign<empty_UDT>::value, false);
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_nothrow_assign<void>::value, true);
// cases we would like to succeed but can't implement in the language:
BOOST_CHECK_SOFT_INTEGRAL_CONSTANT(::tt::has_nothrow_assign<empty_POD_UDT>::value, true, false);
BOOST_CHECK_SOFT_INTEGRAL_CONSTANT(::tt::has_nothrow_assign<POD_UDT>::value, true, false);
BOOST_CHECK_SOFT_INTEGRAL_CONSTANT(::tt::has_nothrow_assign<POD_union_UDT>::value, true, false);
BOOST_CHECK_SOFT_INTEGRAL_CONSTANT(::tt::has_nothrow_assign<empty_POD_union_UDT>::value, true, false);
TT_TEST_END

View File

@@ -0,0 +1,149 @@
#include "test.hpp"
#include "check_integral_constant.hpp"
#include TYPE_TRAITS(has_nothrow_constructor)
TT_TEST_BEGIN(has_nothrow_constructor)
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_nothrow_constructor<bool>::value, true);
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_nothrow_constructor<bool const>::value, true);
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_nothrow_constructor<bool volatile>::value, true);
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_nothrow_constructor<bool const volatile>::value, true);
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_nothrow_constructor<signed char>::value, true);
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_nothrow_constructor<signed char const>::value, true);
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_nothrow_constructor<signed char volatile>::value, true);
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_nothrow_constructor<signed char const volatile>::value, true);
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_nothrow_constructor<unsigned char>::value, true);
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_nothrow_constructor<char>::value, true);
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_nothrow_constructor<unsigned char const>::value, true);
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_nothrow_constructor<char const>::value, true);
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_nothrow_constructor<unsigned char volatile>::value, true);
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_nothrow_constructor<char volatile>::value, true);
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_nothrow_constructor<unsigned char const volatile>::value, true);
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_nothrow_constructor<char const volatile>::value, true);
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_nothrow_constructor<unsigned short>::value, true);
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_nothrow_constructor<short>::value, true);
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_nothrow_constructor<unsigned short const>::value, true);
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_nothrow_constructor<short const>::value, true);
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_nothrow_constructor<unsigned short volatile>::value, true);
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_nothrow_constructor<short volatile>::value, true);
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_nothrow_constructor<unsigned short const volatile>::value, true);
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_nothrow_constructor<short const volatile>::value, true);
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_nothrow_constructor<unsigned int>::value, true);
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_nothrow_constructor<int>::value, true);
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_nothrow_constructor<unsigned int const>::value, true);
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_nothrow_constructor<int const>::value, true);
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_nothrow_constructor<unsigned int volatile>::value, true);
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_nothrow_constructor<int volatile>::value, true);
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_nothrow_constructor<unsigned int const volatile>::value, true);
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_nothrow_constructor<int const volatile>::value, true);
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_nothrow_constructor<unsigned long>::value, true);
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_nothrow_constructor<long>::value, true);
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_nothrow_constructor<unsigned long const>::value, true);
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_nothrow_constructor<long const>::value, true);
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_nothrow_constructor<unsigned long volatile>::value, true);
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_nothrow_constructor<long volatile>::value, true);
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_nothrow_constructor<unsigned long const volatile>::value, true);
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_nothrow_constructor<long const volatile>::value, true);
#ifdef BOOST_HAS_LONG_LONG
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_nothrow_constructor<unsigned long long>::value, true);
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_nothrow_constructor<long long>::value, true);
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_nothrow_constructor<unsigned long long const>::value, true);
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_nothrow_constructor<long long const>::value, true);
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_nothrow_constructor<unsigned long long volatile>::value, true);
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_nothrow_constructor<long long volatile>::value, true);
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_nothrow_constructor<unsigned long long const volatile>::value, true);
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_nothrow_constructor<long long const volatile>::value, true);
#endif
#ifdef BOOST_HAS_MS_INT64
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_nothrow_constructor<unsigned __int8>::value, true);
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_nothrow_constructor<__int8>::value, true);
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_nothrow_constructor<unsigned __int8 const>::value, true);
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_nothrow_constructor<__int8 const>::value, true);
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_nothrow_constructor<unsigned __int8 volatile>::value, true);
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_nothrow_constructor<__int8 volatile>::value, true);
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_nothrow_constructor<unsigned __int8 const volatile>::value, true);
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_nothrow_constructor<__int8 const volatile>::value, true);
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_nothrow_constructor<unsigned __int16>::value, true);
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_nothrow_constructor<__int16>::value, true);
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_nothrow_constructor<unsigned __int16 const>::value, true);
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_nothrow_constructor<__int16 const>::value, true);
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_nothrow_constructor<unsigned __int16 volatile>::value, true);
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_nothrow_constructor<__int16 volatile>::value, true);
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_nothrow_constructor<unsigned __int16 const volatile>::value, true);
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_nothrow_constructor<__int16 const volatile>::value, true);
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_nothrow_constructor<unsigned __int32>::value, true);
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_nothrow_constructor<__int32>::value, true);
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_nothrow_constructor<unsigned __int32 const>::value, true);
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_nothrow_constructor<__int32 const>::value, true);
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_nothrow_constructor<unsigned __int32 volatile>::value, true);
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_nothrow_constructor<__int32 volatile>::value, true);
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_nothrow_constructor<unsigned __int32 const volatile>::value, true);
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_nothrow_constructor<__int32 const volatile>::value, true);
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_nothrow_constructor<unsigned __int64>::value, true);
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_nothrow_constructor<__int64>::value, true);
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_nothrow_constructor<unsigned __int64 const>::value, true);
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_nothrow_constructor<__int64 const>::value, true);
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_nothrow_constructor<unsigned __int64 volatile>::value, true);
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_nothrow_constructor<__int64 volatile>::value, true);
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_nothrow_constructor<unsigned __int64 const volatile>::value, true);
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_nothrow_constructor<__int64 const volatile>::value, true);
#endif
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_nothrow_constructor<float>::value, true);
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_nothrow_constructor<float const>::value, true);
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_nothrow_constructor<float volatile>::value, true);
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_nothrow_constructor<float const volatile>::value, true);
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_nothrow_constructor<double>::value, true);
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_nothrow_constructor<double const>::value, true);
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_nothrow_constructor<double volatile>::value, true);
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_nothrow_constructor<double const volatile>::value, true);
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_nothrow_constructor<long double>::value, true);
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_nothrow_constructor<long double const>::value, true);
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_nothrow_constructor<long double volatile>::value, true);
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_nothrow_constructor<long double const volatile>::value, true);
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_nothrow_constructor<int>::value, true);
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_nothrow_constructor<void*>::value, true);
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_nothrow_constructor<int*const>::value, true);
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_nothrow_constructor<f1>::value, true);
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_nothrow_constructor<f2>::value, true);
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_nothrow_constructor<f3>::value, true);
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_nothrow_constructor<mf1>::value, true);
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_nothrow_constructor<mf2>::value, true);
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_nothrow_constructor<mf3>::value, true);
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_nothrow_constructor<mp>::value, true);
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_nothrow_constructor<cmf>::value, true);
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_nothrow_constructor<enum_UDT>::value, true);
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_nothrow_constructor<int&>::value, false);
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_nothrow_constructor<const int&>::value, false);
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_nothrow_constructor<int[2]>::value, true);
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_nothrow_constructor<int[3][2]>::value, true);
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_nothrow_constructor<int[2][4][5][6][3]>::value, true);
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_nothrow_constructor<UDT>::value, false);
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_nothrow_constructor<empty_UDT>::value, false);
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_nothrow_constructor<void>::value, true);
// cases we would like to succeed but can't implement in the language:
BOOST_CHECK_SOFT_INTEGRAL_CONSTANT(::tt::has_nothrow_constructor<empty_POD_UDT>::value, true, false);
BOOST_CHECK_SOFT_INTEGRAL_CONSTANT(::tt::has_nothrow_constructor<POD_UDT>::value, true, false);
BOOST_CHECK_SOFT_INTEGRAL_CONSTANT(::tt::has_nothrow_constructor<POD_union_UDT>::value, true, false);
BOOST_CHECK_SOFT_INTEGRAL_CONSTANT(::tt::has_nothrow_constructor<empty_POD_union_UDT>::value, true, false);
TT_TEST_END

View File

@@ -0,0 +1,149 @@
#include "test.hpp"
#include "check_integral_constant.hpp"
#include TYPE_TRAITS(has_nothrow_copy)
TT_TEST_BEGIN(has_nothrow_copy)
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_nothrow_copy<bool>::value, true);
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_nothrow_copy<bool const>::value, true);
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_nothrow_copy<bool volatile>::value, false);
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_nothrow_copy<bool const volatile>::value, false);
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_nothrow_copy<signed char>::value, true);
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_nothrow_copy<signed char const>::value, true);
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_nothrow_copy<signed char volatile>::value, false);
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_nothrow_copy<signed char const volatile>::value, false);
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_nothrow_copy<unsigned char>::value, true);
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_nothrow_copy<char>::value, true);
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_nothrow_copy<unsigned char const>::value, true);
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_nothrow_copy<char const>::value, true);
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_nothrow_copy<unsigned char volatile>::value, false);
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_nothrow_copy<char volatile>::value, false);
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_nothrow_copy<unsigned char const volatile>::value, false);
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_nothrow_copy<char const volatile>::value, false);
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_nothrow_copy<unsigned short>::value, true);
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_nothrow_copy<short>::value, true);
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_nothrow_copy<unsigned short const>::value, true);
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_nothrow_copy<short const>::value, true);
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_nothrow_copy<unsigned short volatile>::value, false);
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_nothrow_copy<short volatile>::value, false);
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_nothrow_copy<unsigned short const volatile>::value, false);
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_nothrow_copy<short const volatile>::value, false);
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_nothrow_copy<unsigned int>::value, true);
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_nothrow_copy<int>::value, true);
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_nothrow_copy<unsigned int const>::value, true);
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_nothrow_copy<int const>::value, true);
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_nothrow_copy<unsigned int volatile>::value, false);
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_nothrow_copy<int volatile>::value, false);
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_nothrow_copy<unsigned int const volatile>::value, false);
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_nothrow_copy<int const volatile>::value, false);
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_nothrow_copy<unsigned long>::value, true);
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_nothrow_copy<long>::value, true);
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_nothrow_copy<unsigned long const>::value, true);
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_nothrow_copy<long const>::value, true);
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_nothrow_copy<unsigned long volatile>::value, false);
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_nothrow_copy<long volatile>::value, false);
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_nothrow_copy<unsigned long const volatile>::value, false);
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_nothrow_copy<long const volatile>::value, false);
#ifdef BOOST_HAS_LONG_LONG
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_nothrow_copy<unsigned long long>::value, true);
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_nothrow_copy<long long>::value, true);
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_nothrow_copy<unsigned long long const>::value, true);
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_nothrow_copy<long long const>::value, true);
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_nothrow_copy<unsigned long long volatile>::value, false);
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_nothrow_copy<long long volatile>::value, false);
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_nothrow_copy<unsigned long long const volatile>::value, false);
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_nothrow_copy<long long const volatile>::value, false);
#endif
#ifdef BOOST_HAS_MS_INT64
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_nothrow_copy<unsigned __int8>::value, true);
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_nothrow_copy<__int8>::value, true);
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_nothrow_copy<unsigned __int8 const>::value, true);
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_nothrow_copy<__int8 const>::value, true);
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_nothrow_copy<unsigned __int8 volatile>::value, false);
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_nothrow_copy<__int8 volatile>::value, false);
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_nothrow_copy<unsigned __int8 const volatile>::value, false);
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_nothrow_copy<__int8 const volatile>::value, false);
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_nothrow_copy<unsigned __int16>::value, true);
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_nothrow_copy<__int16>::value, true);
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_nothrow_copy<unsigned __int16 const>::value, true);
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_nothrow_copy<__int16 const>::value, true);
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_nothrow_copy<unsigned __int16 volatile>::value, false);
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_nothrow_copy<__int16 volatile>::value, false);
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_nothrow_copy<unsigned __int16 const volatile>::value, false);
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_nothrow_copy<__int16 const volatile>::value, false);
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_nothrow_copy<unsigned __int32>::value, true);
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_nothrow_copy<__int32>::value, true);
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_nothrow_copy<unsigned __int32 const>::value, true);
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_nothrow_copy<__int32 const>::value, true);
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_nothrow_copy<unsigned __int32 volatile>::value, false);
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_nothrow_copy<__int32 volatile>::value, false);
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_nothrow_copy<unsigned __int32 const volatile>::value, false);
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_nothrow_copy<__int32 const volatile>::value, false);
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_nothrow_copy<unsigned __int64>::value, true);
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_nothrow_copy<__int64>::value, true);
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_nothrow_copy<unsigned __int64 const>::value, true);
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_nothrow_copy<__int64 const>::value, true);
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_nothrow_copy<unsigned __int64 volatile>::value, false);
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_nothrow_copy<__int64 volatile>::value, false);
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_nothrow_copy<unsigned __int64 const volatile>::value, false);
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_nothrow_copy<__int64 const volatile>::value, false);
#endif
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_nothrow_copy<float>::value, true);
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_nothrow_copy<float const>::value, true);
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_nothrow_copy<float volatile>::value, false);
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_nothrow_copy<float const volatile>::value, false);
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_nothrow_copy<double>::value, true);
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_nothrow_copy<double const>::value, true);
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_nothrow_copy<double volatile>::value, false);
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_nothrow_copy<double const volatile>::value, false);
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_nothrow_copy<long double>::value, true);
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_nothrow_copy<long double const>::value, true);
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_nothrow_copy<long double volatile>::value, false);
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_nothrow_copy<long double const volatile>::value, false);
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_nothrow_copy<int>::value, true);
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_nothrow_copy<void*>::value, true);
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_nothrow_copy<int*const>::value, true);
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_nothrow_copy<f1>::value, true);
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_nothrow_copy<f2>::value, true);
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_nothrow_copy<f3>::value, true);
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_nothrow_copy<mf1>::value, true);
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_nothrow_copy<mf2>::value, true);
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_nothrow_copy<mf3>::value, true);
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_nothrow_copy<mp>::value, true);
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_nothrow_copy<cmf>::value, true);
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_nothrow_copy<enum_UDT>::value, true);
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_nothrow_copy<int&>::value, false);
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_nothrow_copy<const int&>::value, false);
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_nothrow_copy<int[2]>::value, true);
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_nothrow_copy<int[3][2]>::value, true);
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_nothrow_copy<int[2][4][5][6][3]>::value, true);
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_nothrow_copy<UDT>::value, false);
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_nothrow_copy<empty_UDT>::value, false);
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_nothrow_copy<void>::value, true);
// cases we would like to succeed but can't implement in the language:
BOOST_CHECK_SOFT_INTEGRAL_CONSTANT(::tt::has_nothrow_copy<empty_POD_UDT>::value, true, false);
BOOST_CHECK_SOFT_INTEGRAL_CONSTANT(::tt::has_nothrow_copy<POD_UDT>::value, true, false);
BOOST_CHECK_SOFT_INTEGRAL_CONSTANT(::tt::has_nothrow_copy<POD_union_UDT>::value, true, false);
BOOST_CHECK_SOFT_INTEGRAL_CONSTANT(::tt::has_nothrow_copy<empty_POD_union_UDT>::value, true, false);
TT_TEST_END

View File

@@ -0,0 +1,149 @@
#include "test.hpp"
#include "check_integral_constant.hpp"
#include TYPE_TRAITS(has_trivial_assign)
TT_TEST_BEGIN(has_trivial_assign)
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_assign<bool>::value, true);
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_assign<bool const>::value, false);
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_assign<bool volatile>::value, false);
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_assign<bool const volatile>::value, false);
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_assign<signed char>::value, true);
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_assign<signed char const>::value, false);
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_assign<signed char volatile>::value, false);
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_assign<signed char const volatile>::value, false);
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_assign<unsigned char>::value, true);
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_assign<char>::value, true);
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_assign<unsigned char const>::value, false);
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_assign<char const>::value, false);
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_assign<unsigned char volatile>::value, false);
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_assign<char volatile>::value, false);
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_assign<unsigned char const volatile>::value, false);
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_assign<char const volatile>::value, false);
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_assign<unsigned short>::value, true);
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_assign<short>::value, true);
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_assign<unsigned short const>::value, false);
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_assign<short const>::value, false);
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_assign<unsigned short volatile>::value, false);
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_assign<short volatile>::value, false);
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_assign<unsigned short const volatile>::value, false);
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_assign<short const volatile>::value, false);
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_assign<unsigned int>::value, true);
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_assign<int>::value, true);
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_assign<unsigned int const>::value, false);
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_assign<int const>::value, false);
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_assign<unsigned int volatile>::value, false);
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_assign<int volatile>::value, false);
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_assign<unsigned int const volatile>::value, false);
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_assign<int const volatile>::value, false);
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_assign<unsigned long>::value, true);
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_assign<long>::value, true);
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_assign<unsigned long const>::value, false);
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_assign<long const>::value, false);
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_assign<unsigned long volatile>::value, false);
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_assign<long volatile>::value, false);
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_assign<unsigned long const volatile>::value, false);
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_assign<long const volatile>::value, false);
#ifdef BOOST_HAS_LONG_LONG
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_assign<unsigned long long>::value, true);
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_assign<long long>::value, true);
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_assign<unsigned long long const>::value, false);
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_assign<long long const>::value, false);
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_assign<unsigned long long volatile>::value, false);
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_assign<long long volatile>::value, false);
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_assign<unsigned long long const volatile>::value, false);
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_assign<long long const volatile>::value, false);
#endif
#ifdef BOOST_HAS_MS_INT64
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_assign<unsigned __int8>::value, true);
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_assign<__int8>::value, true);
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_assign<unsigned __int8 const>::value, false);
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_assign<__int8 const>::value, false);
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_assign<unsigned __int8 volatile>::value, false);
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_assign<__int8 volatile>::value, false);
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_assign<unsigned __int8 const volatile>::value, false);
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_assign<__int8 const volatile>::value, false);
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_assign<unsigned __int16>::value, true);
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_assign<__int16>::value, true);
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_assign<unsigned __int16 const>::value, false);
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_assign<__int16 const>::value, false);
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_assign<unsigned __int16 volatile>::value, false);
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_assign<__int16 volatile>::value, false);
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_assign<unsigned __int16 const volatile>::value, false);
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_assign<__int16 const volatile>::value, false);
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_assign<unsigned __int32>::value, true);
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_assign<__int32>::value, true);
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_assign<unsigned __int32 const>::value, false);
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_assign<__int32 const>::value, false);
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_assign<unsigned __int32 volatile>::value, false);
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_assign<__int32 volatile>::value, false);
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_assign<unsigned __int32 const volatile>::value, false);
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_assign<__int32 const volatile>::value, false);
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_assign<unsigned __int64>::value, true);
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_assign<__int64>::value, true);
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_assign<unsigned __int64 const>::value, false);
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_assign<__int64 const>::value, false);
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_assign<unsigned __int64 volatile>::value, false);
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_assign<__int64 volatile>::value, false);
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_assign<unsigned __int64 const volatile>::value, false);
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_assign<__int64 const volatile>::value, false);
#endif
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_assign<float>::value, true);
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_assign<float const>::value, false);
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_assign<float volatile>::value, false);
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_assign<float const volatile>::value, false);
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_assign<double>::value, true);
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_assign<double const>::value, false);
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_assign<double volatile>::value, false);
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_assign<double const volatile>::value, false);
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_assign<long double>::value, true);
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_assign<long double const>::value, false);
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_assign<long double volatile>::value, false);
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_assign<long double const volatile>::value, false);
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_assign<int>::value, true);
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_assign<void*>::value, true);
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_assign<int*const>::value, false);
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_assign<f1>::value, true);
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_assign<f2>::value, true);
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_assign<f3>::value, true);
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_assign<mf1>::value, true);
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_assign<mf2>::value, true);
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_assign<mf3>::value, true);
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_assign<mp>::value, true);
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_assign<cmf>::value, true);
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_assign<enum_UDT>::value, true);
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_assign<int&>::value, false);
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_assign<const int&>::value, false);
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_assign<int[2]>::value, true);
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_assign<int[3][2]>::value, true);
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_assign<int[2][4][5][6][3]>::value, true);
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_assign<UDT>::value, false);
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_assign<empty_UDT>::value, false);
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_assign<void>::value, true);
// cases we would like to succeed but can't implement in the language:
BOOST_CHECK_SOFT_INTEGRAL_CONSTANT(::tt::has_trivial_assign<empty_POD_UDT>::value, true, false);
BOOST_CHECK_SOFT_INTEGRAL_CONSTANT(::tt::has_trivial_assign<POD_UDT>::value, true, false);
BOOST_CHECK_SOFT_INTEGRAL_CONSTANT(::tt::has_trivial_assign<POD_union_UDT>::value, true, false);
BOOST_CHECK_SOFT_INTEGRAL_CONSTANT(::tt::has_trivial_assign<empty_POD_union_UDT>::value, true, false);
TT_TEST_END

View File

@@ -0,0 +1,155 @@
#include "test.hpp"
#include "check_integral_constant.hpp"
#include TYPE_TRAITS(has_trivial_constructor)
TT_TEST_BEGIN(has_trivial_constructor)
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_constructor<bool>::value, true);
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_constructor<bool const>::value, true);
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_constructor<bool volatile>::value, true);
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_constructor<bool const volatile>::value, true);
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_constructor<signed char>::value, true);
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_constructor<signed char const>::value, true);
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_constructor<signed char volatile>::value, true);
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_constructor<signed char const volatile>::value, true);
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_constructor<unsigned char>::value, true);
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_constructor<char>::value, true);
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_constructor<unsigned char const>::value, true);
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_constructor<char const>::value, true);
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_constructor<unsigned char volatile>::value, true);
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_constructor<char volatile>::value, true);
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_constructor<unsigned char const volatile>::value, true);
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_constructor<char const volatile>::value, true);
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_constructor<unsigned short>::value, true);
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_constructor<short>::value, true);
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_constructor<unsigned short const>::value, true);
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_constructor<short const>::value, true);
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_constructor<unsigned short volatile>::value, true);
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_constructor<short volatile>::value, true);
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_constructor<unsigned short const volatile>::value, true);
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_constructor<short const volatile>::value, true);
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_constructor<unsigned int>::value, true);
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_constructor<int>::value, true);
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_constructor<unsigned int const>::value, true);
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_constructor<int const>::value, true);
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_constructor<unsigned int volatile>::value, true);
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_constructor<int volatile>::value, true);
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_constructor<unsigned int const volatile>::value, true);
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_constructor<int const volatile>::value, true);
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_constructor<unsigned long>::value, true);
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_constructor<long>::value, true);
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_constructor<unsigned long const>::value, true);
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_constructor<long const>::value, true);
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_constructor<unsigned long volatile>::value, true);
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_constructor<long volatile>::value, true);
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_constructor<unsigned long const volatile>::value, true);
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_constructor<long const volatile>::value, true);
#ifdef BOOST_HAS_LONG_LONG
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_constructor<unsigned long long>::value, true);
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_constructor<long long>::value, true);
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_constructor<unsigned long long const>::value, true);
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_constructor<long long const>::value, true);
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_constructor<unsigned long long volatile>::value, true);
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_constructor<long long volatile>::value, true);
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_constructor<unsigned long long const volatile>::value, true);
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_constructor<long long const volatile>::value, true);
#endif
#ifdef BOOST_HAS_MS_INT64
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_constructor<unsigned __int8>::value, true);
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_constructor<__int8>::value, true);
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_constructor<unsigned __int8 const>::value, true);
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_constructor<__int8 const>::value, true);
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_constructor<unsigned __int8 volatile>::value, true);
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_constructor<__int8 volatile>::value, true);
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_constructor<unsigned __int8 const volatile>::value, true);
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_constructor<__int8 const volatile>::value, true);
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_constructor<unsigned __int16>::value, true);
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_constructor<__int16>::value, true);
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_constructor<unsigned __int16 const>::value, true);
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_constructor<__int16 const>::value, true);
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_constructor<unsigned __int16 volatile>::value, true);
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_constructor<__int16 volatile>::value, true);
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_constructor<unsigned __int16 const volatile>::value, true);
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_constructor<__int16 const volatile>::value, true);
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_constructor<unsigned __int32>::value, true);
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_constructor<__int32>::value, true);
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_constructor<unsigned __int32 const>::value, true);
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_constructor<__int32 const>::value, true);
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_constructor<unsigned __int32 volatile>::value, true);
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_constructor<__int32 volatile>::value, true);
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_constructor<unsigned __int32 const volatile>::value, true);
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_constructor<__int32 const volatile>::value, true);
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_constructor<unsigned __int64>::value, true);
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_constructor<__int64>::value, true);
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_constructor<unsigned __int64 const>::value, true);
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_constructor<__int64 const>::value, true);
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_constructor<unsigned __int64 volatile>::value, true);
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_constructor<__int64 volatile>::value, true);
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_constructor<unsigned __int64 const volatile>::value, true);
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_constructor<__int64 const volatile>::value, true);
#endif
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_constructor<float>::value, true);
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_constructor<float const>::value, true);
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_constructor<float volatile>::value, true);
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_constructor<float const volatile>::value, true);
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_constructor<double>::value, true);
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_constructor<double const>::value, true);
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_constructor<double volatile>::value, true);
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_constructor<double const volatile>::value, true);
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_constructor<long double>::value, true);
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_constructor<long double const>::value, true);
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_constructor<long double volatile>::value, true);
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_constructor<long double const volatile>::value, true);
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_constructor<int>::value, true);
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_constructor<void*>::value, true);
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_constructor<int*const>::value, true);
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_constructor<f1>::value, true);
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_constructor<f2>::value, true);
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_constructor<f3>::value, true);
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_constructor<mf1>::value, true);
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_constructor<mf2>::value, true);
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_constructor<mf3>::value, true);
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_constructor<mp>::value, true);
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_constructor<cmf>::value, true);
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_constructor<enum_UDT>::value, true);
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_constructor<int&>::value, false);
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_constructor<const int&>::value, false);
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_constructor<int[2]>::value, true);
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_constructor<int[3][2]>::value, true);
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_constructor<int[2][4][5][6][3]>::value, true);
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_constructor<UDT>::value, false);
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_constructor<empty_UDT>::value, false);
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_constructor<void>::value, true);
// cases we would like to succeed but can't implement in the language:
BOOST_CHECK_SOFT_INTEGRAL_CONSTANT(::tt::has_trivial_constructor<empty_POD_UDT>::value, true, false);
BOOST_CHECK_SOFT_INTEGRAL_CONSTANT(::tt::has_trivial_constructor<POD_UDT>::value, true, false);
BOOST_CHECK_SOFT_INTEGRAL_CONSTANT(::tt::has_trivial_constructor<POD_union_UDT>::value, true, false);
BOOST_CHECK_SOFT_INTEGRAL_CONSTANT(::tt::has_trivial_constructor<empty_POD_union_UDT>::value, true, false);
TT_TEST_END

View File

@@ -0,0 +1,155 @@
#include "test.hpp"
#include "check_integral_constant.hpp"
#include TYPE_TRAITS(has_trivial_copy)
TT_TEST_BEGIN(has_trivial_copy)
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_copy<bool>::value, true);
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_copy<bool const>::value, true);
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_copy<bool volatile>::value, false);
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_copy<bool const volatile>::value, false);
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_copy<signed char>::value, true);
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_copy<signed char const>::value, true);
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_copy<signed char volatile>::value, false);
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_copy<signed char const volatile>::value, false);
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_copy<unsigned char>::value, true);
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_copy<char>::value, true);
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_copy<unsigned char const>::value, true);
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_copy<char const>::value, true);
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_copy<unsigned char volatile>::value, false);
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_copy<char volatile>::value, false);
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_copy<unsigned char const volatile>::value, false);
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_copy<char const volatile>::value, false);
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_copy<unsigned short>::value, true);
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_copy<short>::value, true);
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_copy<unsigned short const>::value, true);
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_copy<short const>::value, true);
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_copy<unsigned short volatile>::value, false);
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_copy<short volatile>::value, false);
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_copy<unsigned short const volatile>::value, false);
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_copy<short const volatile>::value, false);
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_copy<unsigned int>::value, true);
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_copy<int>::value, true);
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_copy<unsigned int const>::value, true);
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_copy<int const>::value, true);
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_copy<unsigned int volatile>::value, false);
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_copy<int volatile>::value, false);
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_copy<unsigned int const volatile>::value, false);
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_copy<int const volatile>::value, false);
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_copy<unsigned long>::value, true);
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_copy<long>::value, true);
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_copy<unsigned long const>::value, true);
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_copy<long const>::value, true);
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_copy<unsigned long volatile>::value, false);
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_copy<long volatile>::value, false);
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_copy<unsigned long const volatile>::value, false);
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_copy<long const volatile>::value, false);
#ifdef BOOST_HAS_LONG_LONG
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_copy<unsigned long long>::value, true);
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_copy<long long>::value, true);
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_copy<unsigned long long const>::value, true);
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_copy<long long const>::value, true);
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_copy<unsigned long long volatile>::value, false);
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_copy<long long volatile>::value, false);
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_copy<unsigned long long const volatile>::value, false);
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_copy<long long const volatile>::value, false);
#endif
#ifdef BOOST_HAS_MS_INT64
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_copy<unsigned __int8>::value, true);
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_copy<__int8>::value, true);
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_copy<unsigned __int8 const>::value, true);
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_copy<__int8 const>::value, true);
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_copy<unsigned __int8 volatile>::value, false);
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_copy<__int8 volatile>::value, false);
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_copy<unsigned __int8 const volatile>::value, false);
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_copy<__int8 const volatile>::value, false);
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_copy<unsigned __int16>::value, true);
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_copy<__int16>::value, true);
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_copy<unsigned __int16 const>::value, true);
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_copy<__int16 const>::value, true);
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_copy<unsigned __int16 volatile>::value, false);
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_copy<__int16 volatile>::value, false);
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_copy<unsigned __int16 const volatile>::value, false);
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_copy<__int16 const volatile>::value, false);
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_copy<unsigned __int32>::value, true);
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_copy<__int32>::value, true);
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_copy<unsigned __int32 const>::value, true);
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_copy<__int32 const>::value, true);
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_copy<unsigned __int32 volatile>::value, false);
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_copy<__int32 volatile>::value, false);
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_copy<unsigned __int32 const volatile>::value, false);
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_copy<__int32 const volatile>::value, false);
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_copy<unsigned __int64>::value, true);
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_copy<__int64>::value, true);
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_copy<unsigned __int64 const>::value, true);
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_copy<__int64 const>::value, true);
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_copy<unsigned __int64 volatile>::value, false);
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_copy<__int64 volatile>::value, false);
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_copy<unsigned __int64 const volatile>::value, false);
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_copy<__int64 const volatile>::value, false);
#endif
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_copy<float>::value, true);
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_copy<float const>::value, true);
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_copy<float volatile>::value, false);
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_copy<float const volatile>::value, false);
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_copy<double>::value, true);
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_copy<double const>::value, true);
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_copy<double volatile>::value, false);
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_copy<double const volatile>::value, false);
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_copy<long double>::value, true);
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_copy<long double const>::value, true);
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_copy<long double volatile>::value, false);
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_copy<long double const volatile>::value, false);
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_copy<int>::value, true);
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_copy<void*>::value, true);
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_copy<int*const>::value, true);
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_copy<f1>::value, true);
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_copy<f2>::value, true);
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_copy<f3>::value, true);
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_copy<mf1>::value, true);
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_copy<mf2>::value, true);
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_copy<mf3>::value, true);
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_copy<mp>::value, true);
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_copy<cmf>::value, true);
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_copy<enum_UDT>::value, true);
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_copy<int&>::value, false);
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_copy<const int&>::value, false);
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_copy<int[2]>::value, true);
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_copy<int[3][2]>::value, true);
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_copy<int[2][4][5][6][3]>::value, true);
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_copy<UDT>::value, false);
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_copy<empty_UDT>::value, false);
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_copy<void>::value, true);
// cases we would like to succeed but can't implement in the language:
BOOST_CHECK_SOFT_INTEGRAL_CONSTANT(::tt::has_trivial_copy<empty_POD_UDT>::value, true, false);
BOOST_CHECK_SOFT_INTEGRAL_CONSTANT(::tt::has_trivial_copy<POD_UDT>::value, true, false);
BOOST_CHECK_SOFT_INTEGRAL_CONSTANT(::tt::has_trivial_copy<POD_union_UDT>::value, true, false);
BOOST_CHECK_SOFT_INTEGRAL_CONSTANT(::tt::has_trivial_copy<empty_POD_union_UDT>::value, true, false);
TT_TEST_END

View File

@@ -0,0 +1,149 @@
#include "test.hpp"
#include "check_integral_constant.hpp"
#include TYPE_TRAITS(has_trivial_destructor)
TT_TEST_BEGIN(has_trivial_destructor)
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_destructor<bool>::value, true);
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_destructor<bool const>::value, true);
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_destructor<bool volatile>::value, true);
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_destructor<bool const volatile>::value, true);
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_destructor<signed char>::value, true);
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_destructor<signed char const>::value, true);
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_destructor<signed char volatile>::value, true);
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_destructor<signed char const volatile>::value, true);
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_destructor<unsigned char>::value, true);
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_destructor<char>::value, true);
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_destructor<unsigned char const>::value, true);
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_destructor<char const>::value, true);
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_destructor<unsigned char volatile>::value, true);
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_destructor<char volatile>::value, true);
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_destructor<unsigned char const volatile>::value, true);
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_destructor<char const volatile>::value, true);
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_destructor<unsigned short>::value, true);
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_destructor<short>::value, true);
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_destructor<unsigned short const>::value, true);
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_destructor<short const>::value, true);
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_destructor<unsigned short volatile>::value, true);
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_destructor<short volatile>::value, true);
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_destructor<unsigned short const volatile>::value, true);
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_destructor<short const volatile>::value, true);
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_destructor<unsigned int>::value, true);
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_destructor<int>::value, true);
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_destructor<unsigned int const>::value, true);
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_destructor<int const>::value, true);
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_destructor<unsigned int volatile>::value, true);
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_destructor<int volatile>::value, true);
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_destructor<unsigned int const volatile>::value, true);
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_destructor<int const volatile>::value, true);
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_destructor<unsigned long>::value, true);
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_destructor<long>::value, true);
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_destructor<unsigned long const>::value, true);
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_destructor<long const>::value, true);
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_destructor<unsigned long volatile>::value, true);
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_destructor<long volatile>::value, true);
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_destructor<unsigned long const volatile>::value, true);
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_destructor<long const volatile>::value, true);
#ifdef BOOST_HAS_LONG_LONG
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_destructor<unsigned long long>::value, true);
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_destructor<long long>::value, true);
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_destructor<unsigned long long const>::value, true);
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_destructor<long long const>::value, true);
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_destructor<unsigned long long volatile>::value, true);
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_destructor<long long volatile>::value, true);
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_destructor<unsigned long long const volatile>::value, true);
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_destructor<long long const volatile>::value, true);
#endif
#ifdef BOOST_HAS_MS_INT64
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_destructor<unsigned __int8>::value, true);
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_destructor<__int8>::value, true);
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_destructor<unsigned __int8 const>::value, true);
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_destructor<__int8 const>::value, true);
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_destructor<unsigned __int8 volatile>::value, true);
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_destructor<__int8 volatile>::value, true);
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_destructor<unsigned __int8 const volatile>::value, true);
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_destructor<__int8 const volatile>::value, true);
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_destructor<unsigned __int16>::value, true);
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_destructor<__int16>::value, true);
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_destructor<unsigned __int16 const>::value, true);
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_destructor<__int16 const>::value, true);
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_destructor<unsigned __int16 volatile>::value, true);
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_destructor<__int16 volatile>::value, true);
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_destructor<unsigned __int16 const volatile>::value, true);
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_destructor<__int16 const volatile>::value, true);
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_destructor<unsigned __int32>::value, true);
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_destructor<__int32>::value, true);
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_destructor<unsigned __int32 const>::value, true);
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_destructor<__int32 const>::value, true);
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_destructor<unsigned __int32 volatile>::value, true);
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_destructor<__int32 volatile>::value, true);
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_destructor<unsigned __int32 const volatile>::value, true);
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_destructor<__int32 const volatile>::value, true);
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_destructor<unsigned __int64>::value, true);
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_destructor<__int64>::value, true);
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_destructor<unsigned __int64 const>::value, true);
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_destructor<__int64 const>::value, true);
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_destructor<unsigned __int64 volatile>::value, true);
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_destructor<__int64 volatile>::value, true);
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_destructor<unsigned __int64 const volatile>::value, true);
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_destructor<__int64 const volatile>::value, true);
#endif
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_destructor<float>::value, true);
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_destructor<float const>::value, true);
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_destructor<float volatile>::value, true);
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_destructor<float const volatile>::value, true);
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_destructor<double>::value, true);
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_destructor<double const>::value, true);
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_destructor<double volatile>::value, true);
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_destructor<double const volatile>::value, true);
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_destructor<long double>::value, true);
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_destructor<long double const>::value, true);
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_destructor<long double volatile>::value, true);
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_destructor<long double const volatile>::value, true);
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_destructor<int>::value, true);
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_destructor<void*>::value, true);
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_destructor<int*const>::value, true);
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_destructor<f1>::value, true);
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_destructor<f2>::value, true);
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_destructor<f3>::value, true);
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_destructor<mf1>::value, true);
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_destructor<mf2>::value, true);
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_destructor<mf3>::value, true);
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_destructor<mp>::value, true);
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_destructor<cmf>::value, true);
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_destructor<enum_UDT>::value, true);
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_destructor<int&>::value, false);
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_destructor<const int&>::value, false);
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_destructor<int[2]>::value, true);
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_destructor<int[3][2]>::value, true);
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_destructor<int[2][4][5][6][3]>::value, true);
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_destructor<UDT>::value, false);
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_destructor<empty_UDT>::value, false);
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_destructor<void>::value, true);
// cases we would like to succeed but can't implement in the language:
BOOST_CHECK_SOFT_INTEGRAL_CONSTANT(::tt::has_trivial_destructor<empty_POD_UDT>::value, true, false);
BOOST_CHECK_SOFT_INTEGRAL_CONSTANT(::tt::has_trivial_destructor<POD_UDT>::value, true, false);
BOOST_CHECK_SOFT_INTEGRAL_CONSTANT(::tt::has_trivial_destructor<POD_union_UDT>::value, true, false);
BOOST_CHECK_SOFT_INTEGRAL_CONSTANT(::tt::has_trivial_destructor<empty_POD_union_UDT>::value, true, false);
TT_TEST_END

16
test/init.cpp Normal file
View File

@@ -0,0 +1,16 @@
#include "test.hpp"
boost::unit_test_framework::test_suite* get_master_unit(const char* name)
{
static boost::unit_test_framework::test_suite* ptest_suite = 0;
if(0 == ptest_suite)
ptest_suite = BOOST_TEST_SUITE( name ? name : "" );
return ptest_suite;
}
boost::unit_test_framework::test_suite* init_unit_test_suite ( int , char* [] )
{
return get_master_unit();
}

139
test/is_arithmetic_test.cpp Normal file
View File

@@ -0,0 +1,139 @@
#include "test.hpp"
#include "check_integral_constant.hpp"
#include TYPE_TRAITS(is_arithmetic)
TT_TEST_BEGIN(is_arithmetic)
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_arithmetic<bool>::value, true);
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_arithmetic<bool const>::value, true);
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_arithmetic<bool volatile>::value, true);
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_arithmetic<bool const volatile>::value, true);
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_arithmetic<signed char>::value, true);
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_arithmetic<signed char const>::value, true);
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_arithmetic<signed char volatile>::value, true);
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_arithmetic<signed char const volatile>::value, true);
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_arithmetic<unsigned char>::value, true);
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_arithmetic<char>::value, true);
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_arithmetic<unsigned char const>::value, true);
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_arithmetic<char const>::value, true);
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_arithmetic<unsigned char volatile>::value, true);
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_arithmetic<char volatile>::value, true);
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_arithmetic<unsigned char const volatile>::value, true);
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_arithmetic<char const volatile>::value, true);
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_arithmetic<unsigned short>::value, true);
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_arithmetic<short>::value, true);
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_arithmetic<unsigned short const>::value, true);
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_arithmetic<short const>::value, true);
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_arithmetic<unsigned short volatile>::value, true);
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_arithmetic<short volatile>::value, true);
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_arithmetic<unsigned short const volatile>::value, true);
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_arithmetic<short const volatile>::value, true);
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_arithmetic<unsigned int>::value, true);
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_arithmetic<int>::value, true);
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_arithmetic<unsigned int const>::value, true);
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_arithmetic<int const>::value, true);
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_arithmetic<unsigned int volatile>::value, true);
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_arithmetic<int volatile>::value, true);
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_arithmetic<unsigned int const volatile>::value, true);
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_arithmetic<int const volatile>::value, true);
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_arithmetic<unsigned long>::value, true);
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_arithmetic<long>::value, true);
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_arithmetic<unsigned long const>::value, true);
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_arithmetic<long const>::value, true);
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_arithmetic<unsigned long volatile>::value, true);
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_arithmetic<long volatile>::value, true);
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_arithmetic<unsigned long const volatile>::value, true);
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_arithmetic<long const volatile>::value, true);
#ifdef BOOST_HAS_LONG_LONG
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_arithmetic<unsigned long long>::value, true);
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_arithmetic<long long>::value, true);
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_arithmetic<unsigned long long const>::value, true);
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_arithmetic<long long const>::value, true);
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_arithmetic<unsigned long long volatile>::value, true);
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_arithmetic<long long volatile>::value, true);
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_arithmetic<unsigned long long const volatile>::value, true);
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_arithmetic<long long const volatile>::value, true);
#endif
#ifdef BOOST_HAS_MS_INT64
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_arithmetic<unsigned __int8>::value, true);
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_arithmetic<__int8>::value, true);
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_arithmetic<unsigned __int8 const>::value, true);
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_arithmetic<__int8 const>::value, true);
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_arithmetic<unsigned __int8 volatile>::value, true);
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_arithmetic<__int8 volatile>::value, true);
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_arithmetic<unsigned __int8 const volatile>::value, true);
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_arithmetic<__int8 const volatile>::value, true);
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_arithmetic<unsigned __int16>::value, true);
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_arithmetic<__int16>::value, true);
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_arithmetic<unsigned __int16 const>::value, true);
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_arithmetic<__int16 const>::value, true);
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_arithmetic<unsigned __int16 volatile>::value, true);
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_arithmetic<__int16 volatile>::value, true);
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_arithmetic<unsigned __int16 const volatile>::value, true);
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_arithmetic<__int16 const volatile>::value, true);
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_arithmetic<unsigned __int32>::value, true);
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_arithmetic<__int32>::value, true);
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_arithmetic<unsigned __int32 const>::value, true);
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_arithmetic<__int32 const>::value, true);
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_arithmetic<unsigned __int32 volatile>::value, true);
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_arithmetic<__int32 volatile>::value, true);
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_arithmetic<unsigned __int32 const volatile>::value, true);
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_arithmetic<__int32 const volatile>::value, true);
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_arithmetic<unsigned __int64>::value, true);
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_arithmetic<__int64>::value, true);
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_arithmetic<unsigned __int64 const>::value, true);
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_arithmetic<__int64 const>::value, true);
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_arithmetic<unsigned __int64 volatile>::value, true);
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_arithmetic<__int64 volatile>::value, true);
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_arithmetic<unsigned __int64 const volatile>::value, true);
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_arithmetic<__int64 const volatile>::value, true);
#endif
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_arithmetic<float>::value, true);
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_arithmetic<float const>::value, true);
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_arithmetic<float volatile>::value, true);
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_arithmetic<float const volatile>::value, true);
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_arithmetic<double>::value, true);
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_arithmetic<double const>::value, true);
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_arithmetic<double volatile>::value, true);
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_arithmetic<double const volatile>::value, true);
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_arithmetic<long double>::value, true);
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_arithmetic<long double const>::value, true);
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_arithmetic<long double volatile>::value, true);
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_arithmetic<long double const volatile>::value, true);
//
// cases that should not be true:
//
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_arithmetic<void>::value, false);
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_arithmetic<UDT>::value, false);
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_arithmetic<test_abc1>::value, false);
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_arithmetic<empty_UDT>::value, false);
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_arithmetic<float*>::value, false);
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_arithmetic<float&>::value, false);
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_arithmetic<const float&>::value, false);
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_arithmetic<float[2]>::value, false);
TT_TEST_END

37
test/is_array_test.cpp Normal file
View File

@@ -0,0 +1,37 @@
#include "test.hpp"
#include "check_integral_constant.hpp"
#include TYPE_TRAITS(is_array)
struct convertible_to_pointer
{
operator char*() const;
};
TT_TEST_BEGIN(is_array)
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_array<int>::value, false);
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_array<int*>::value, false);
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_array<const int*>::value, false);
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_array<const volatile int*>::value, false);
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_array<int*const>::value, false);
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_array<const int*volatile>::value, false);
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_array<const volatile int*const>::value, false);
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_array<int[2]>::value, true);
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_array<const int[2]>::value, true);
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_array<const volatile int[2]>::value, true);
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_array<int[2][3]>::value, true);
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_array<UDT[2]>::value, true);
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_array<int(&)[2]>::value, false);
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_array<f1>::value, false);
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_array<void>::value, false);
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_array<test_abc1>::value, false);
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_array<convertible_to_pointer>::value, false);
TT_TEST_END

View File

@@ -0,0 +1,26 @@
#include "test.hpp"
#include "check_integral_constant.hpp"
#include TYPE_TRAITS(is_base_and_derived)
TT_TEST_BEGIN(is_base_and_derived)
BOOST_CHECK_INTEGRAL_CONSTANT((::tt::is_base_and_derived<Derived,Base>::value), false);
BOOST_CHECK_INTEGRAL_CONSTANT((::tt::is_base_and_derived<Derived,Derived>::value), true);
BOOST_CHECK_INTEGRAL_CONSTANT((::tt::is_base_and_derived<Base,Base>::value), true);
BOOST_CHECK_INTEGRAL_CONSTANT((::tt::is_base_and_derived<Base,Derived>::value), true);
BOOST_CHECK_INTEGRAL_CONSTANT((::tt::is_base_and_derived<NonDerived,Base>::value), false);
BOOST_CHECK_INTEGRAL_CONSTANT((::tt::is_base_and_derived<Base,void>::value), false);
BOOST_CHECK_INTEGRAL_CONSTANT((::tt::is_base_and_derived<Base,const void>::value), false);
BOOST_CHECK_INTEGRAL_CONSTANT((::tt::is_base_and_derived<void,Derived>::value), false);
BOOST_CHECK_INTEGRAL_CONSTANT((::tt::is_base_and_derived<const void,Derived>::value), false);
BOOST_CHECK_INTEGRAL_CONSTANT((::tt::is_base_and_derived<int, int>::value), false);
BOOST_CHECK_INTEGRAL_CONSTANT((::tt::is_base_and_derived<const int, int>::value), false);
TT_TEST_END

40
test/is_class_test.cpp Normal file
View File

@@ -0,0 +1,40 @@
#include "test.hpp"
#include "check_integral_constant.hpp"
#include TYPE_TRAITS(is_class)
TT_TEST_BEGIN(is_class)
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_class<int>::value, false);
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_class<const int>::value, false);
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_class<volatile int>::value, false);
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_class<int*>::value, false);
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_class<int* const>::value, false);
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_class<int[2]>::value, false);
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_class<int&>::value, false);
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_class<mf4>::value, false);
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_class<f1>::value, false);
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_class<enum_UDT>::value, false);
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_class<union_UDT>::value, false);
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_class<POD_union_UDT>::value, false);
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_class<empty_union_UDT>::value, false);
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_class<empty_POD_union_UDT>::value, false);
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_class<UDT>::value, true);
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_class<UDT const>::value, true);
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_class<UDT volatile>::value, true);
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_class<empty_UDT>::value, true);
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_class<std::iostream>::value, true);
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_class<UDT*>::value, false);
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_class<UDT[2]>::value, false);
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_class<UDT&>::value, false);
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_class<void>::value, false);
TT_TEST_END

22
test/is_compound_test.cpp Normal file
View File

@@ -0,0 +1,22 @@
#include "test.hpp"
#include "check_integral_constant.hpp"
#include TYPE_TRAITS(is_compound)
TT_TEST_BEGIN(is_compound)
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_compound<UDT>::value, true);
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_compound<void*>::value, true);
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_compound<void>::value, false);
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_compound<int>::value, false);
//#ifndef BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_compound<test_abc1>::value, true);
//#endif
TT_TEST_END

25
test/is_const_test.cpp Normal file
View File

@@ -0,0 +1,25 @@
#include "test.hpp"
#include "check_integral_constant.hpp"
#include TYPE_TRAITS(is_const)
TT_TEST_BEGIN(is_const)
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_const<void>::value, false);
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_const<const void>::value, true);
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_const<test_abc1>::value, false);
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_const<const test_abc1>::value, true);
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_const<int>::value, false);
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_const<const int>::value, true);
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_const<const UDT>::value, true);
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_const<const volatile UDT>::value, true);
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_const<const int&>::value, false);
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_const<cr_type>::value, false);
TT_TEST_END

View File

@@ -0,0 +1,86 @@
#include "test.hpp"
#include "check_integral_constant.hpp"
#include TYPE_COMPARE(is_convertible)
template <class T>
struct convertible_from
{
convertible_from(T);
};
TT_TEST_BEGIN(is_convertible)
BOOST_CHECK_INTEGRAL_CONSTANT((::tt::is_convertible<Derived,Base>::value), true);
BOOST_CHECK_INTEGRAL_CONSTANT((::tt::is_convertible<Derived,Derived>::value), true);
BOOST_CHECK_INTEGRAL_CONSTANT((::tt::is_convertible<Base,Base>::value), true);
BOOST_CHECK_INTEGRAL_CONSTANT((::tt::is_convertible<Base,Derived>::value), false);
BOOST_CHECK_INTEGRAL_CONSTANT((::tt::is_convertible<Derived,Derived>::value), true);
BOOST_CHECK_INTEGRAL_CONSTANT((::tt::is_convertible<NonDerived,Base>::value), false);
BOOST_CHECK_INTEGRAL_CONSTANT((::tt::is_convertible<float,int>::value), true);
// The following four do not compile without member template support:
BOOST_CHECK_INTEGRAL_CONSTANT((::tt::is_convertible<float,void>::value), false);
BOOST_CHECK_INTEGRAL_CONSTANT((::tt::is_convertible<void,void>::value), true);
BOOST_CHECK_INTEGRAL_CONSTANT((::tt::is_convertible<enum1, int>::value), true);
BOOST_CHECK_INTEGRAL_CONSTANT((::tt::is_convertible<Derived*, Base*>::value), true);
BOOST_CHECK_INTEGRAL_CONSTANT((::tt::is_convertible<Base*, Derived*>::value), false);
BOOST_CHECK_INTEGRAL_CONSTANT((::tt::is_convertible<Derived&, Base&>::value), true);
BOOST_CHECK_INTEGRAL_CONSTANT((::tt::is_convertible<Base&, Derived&>::value), false);
BOOST_CHECK_INTEGRAL_CONSTANT((::tt::is_convertible<const Derived*, const Base*>::value), true);
BOOST_CHECK_INTEGRAL_CONSTANT((::tt::is_convertible<const Base*, const Derived*>::value), false);
BOOST_CHECK_INTEGRAL_CONSTANT((::tt::is_convertible<const Derived&, const Base&>::value), true);
BOOST_CHECK_INTEGRAL_CONSTANT((::tt::is_convertible<const Base&, const Derived&>::value), false);
BOOST_CHECK_INTEGRAL_CONSTANT((::tt::is_convertible<const int *, int*>::value), false);
BOOST_CHECK_INTEGRAL_CONSTANT((::tt::is_convertible<const int&, int&>::value), false);
BOOST_CHECK_INTEGRAL_CONSTANT((::tt::is_convertible<int*, int[2]>::value), true);
BOOST_CHECK_INTEGRAL_CONSTANT((::tt::is_convertible<const int*, int[3]>::value), false);
BOOST_CHECK_INTEGRAL_CONSTANT((::tt::is_convertible<const int&, int>::value), true);
BOOST_CHECK_INTEGRAL_CONSTANT((::tt::is_convertible<int(&)[4], const int*>::value), true);
BOOST_CHECK_INTEGRAL_CONSTANT((::tt::is_convertible<int(&)(int), int(*)(int)>::value), true);
BOOST_CHECK_INTEGRAL_CONSTANT((::tt::is_convertible<int *, const int*>::value), true);
BOOST_CHECK_INTEGRAL_CONSTANT((::tt::is_convertible<int&, const int&>::value), true);
BOOST_CHECK_INTEGRAL_CONSTANT((::tt::is_convertible<int[2], int*>::value), true);
BOOST_CHECK_INTEGRAL_CONSTANT((::tt::is_convertible<int[2], const int*>::value), true);
BOOST_CHECK_INTEGRAL_CONSTANT((::tt::is_convertible<const int[2], int*>::value), false);
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_CHECK_INTEGRAL_CONSTANT((::tt::is_convertible<non_int_pointer, void*>::value), true);
BOOST_CHECK_INTEGRAL_CONSTANT((::tt::is_convertible<test_abc1&, test_abc2&>::value), false);
BOOST_CHECK_INTEGRAL_CONSTANT((::tt::is_convertible<test_abc1&, int_constructible>::value), false);
BOOST_CHECK_INTEGRAL_CONSTANT((::tt::is_convertible<int_constructible, test_abc1&>::value), false);
//
// the following tests all involve user defined conversions which do
// not compile with Borland C++ Builder:
//
BOOST_CHECK_INTEGRAL_CONSTANT((::tt::is_convertible<int, int_constructible>::value), true);
BOOST_CHECK_INTEGRAL_CONSTANT((::tt::is_convertible<float,convertible_from<float> >::value), true);
BOOST_CHECK_INTEGRAL_CONSTANT((::tt::is_convertible<float,convertible_from<float const&> >::value), true);
BOOST_CHECK_INTEGRAL_CONSTANT((::tt::is_convertible<float,convertible_from<float&> >::value), true);
BOOST_CHECK_INTEGRAL_CONSTANT((::tt::is_convertible<float,convertible_from<char> >::value), true);
BOOST_CHECK_INTEGRAL_CONSTANT((::tt::is_convertible<float,convertible_from<char const&> >::value), true);
BOOST_CHECK_INTEGRAL_CONSTANT((::tt::is_convertible<float,convertible_from<char&> >::value), false);
BOOST_CHECK_INTEGRAL_CONSTANT((::tt::is_convertible<char,convertible_from<char> >::value), true);
BOOST_CHECK_INTEGRAL_CONSTANT((::tt::is_convertible<char,convertible_from<char const&> >::value), true);
BOOST_CHECK_INTEGRAL_CONSTANT((::tt::is_convertible<char,convertible_from<char&> >::value), true);
BOOST_CHECK_INTEGRAL_CONSTANT((::tt::is_convertible<float&,convertible_from<float> >::value), true);
BOOST_CHECK_INTEGRAL_CONSTANT((::tt::is_convertible<float const&,convertible_from<float> >::value), true);
BOOST_CHECK_INTEGRAL_CONSTANT((::tt::is_convertible<float&,convertible_from<float&> >::value), true);
BOOST_CHECK_INTEGRAL_CONSTANT((::tt::is_convertible<float const&,convertible_from<float const&> >::value), true);
BOOST_CHECK_INTEGRAL_CONSTANT((::tt::is_convertible<float&,convertible_from<float const&> >::value), true);
TT_TEST_END

39
test/is_empty_test.cpp Normal file
View File

@@ -0,0 +1,39 @@
#include "test.hpp"
#include "check_integral_constant.hpp"
#include TYPE_TRAITS(is_empty)
struct non_default_constructable_UDT
{
non_default_constructable_UDT(const non_default_constructable_UDT&){}
private:
non_default_constructable_UDT(){}
};
TT_TEST_BEGIN(is_empty)
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_empty<int>::value, false);
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_empty<int*>::value, false);
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_empty<int&>::value, false);
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_empty<void>::value, false);
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_empty<int[2]>::value, false);
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_empty<f1>::value, false);
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_empty<mf1>::value, false);
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_empty<UDT>::value, false);
BOOST_CHECK_SOFT_INTEGRAL_CONSTANT(::tt::is_empty<empty_UDT>::value, true, false);
BOOST_CHECK_SOFT_INTEGRAL_CONSTANT(::tt::is_empty<empty_POD_UDT>::value, true, false);
BOOST_CHECK_SOFT_INTEGRAL_CONSTANT(::tt::is_empty<non_default_constructable_UDT>::value, true, false);
BOOST_CHECK_SOFT_INTEGRAL_CONSTANT(::tt::is_empty<boost::noncopyable>::value, true, false);
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_empty<enum_UDT>::value, false);
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_empty<non_empty>::value, false);
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_empty<const non_empty&>::value, false);
TT_TEST_END

22
test/is_enum_test.cpp Normal file
View File

@@ -0,0 +1,22 @@
#include "test.hpp"
#include "check_integral_constant.hpp"
#include TYPE_TRAITS(is_enum)
TT_TEST_BEGIN(is_enum)
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_enum<int>::value, false);
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_enum<enum_UDT>::value, true);
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_enum<int_convertible>::value, false);
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_enum<int&>::value, false);
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_enum<boost::noncopyable>::value, false);
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_enum<void>::value, false);
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_enum<test_abc1>::value, false);
TT_TEST_END

42
test/is_float_test.cpp Normal file
View File

@@ -0,0 +1,42 @@
#include "test.hpp"
#include "check_integral_constant.hpp"
#include TYPE_TRAITS(is_float)
TT_TEST_BEGIN(is_float)
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_float<float>::value, true);
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_float<float const>::value, true);
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_float<float volatile>::value, true);
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_float<float const volatile>::value, true);
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_float<double>::value, true);
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_float<double const>::value, true);
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_float<double volatile>::value, true);
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_float<double const volatile>::value, true);
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_float<long double>::value, true);
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_float<long double const>::value, true);
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_float<long double volatile>::value, true);
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_float<long double const volatile>::value, true);
//
// cases that should not be true:
//
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_float<void>::value, false);
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_float<int>::value, false);
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_float<UDT>::value, false);
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_float<test_abc1>::value, false);
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_float<empty_UDT>::value, false);
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_float<float*>::value, false);
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_float<float&>::value, false);
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_float<const float&>::value, false);
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_float<float[2]>::value, false);
TT_TEST_END

34
test/is_function_test.cpp Normal file
View File

@@ -0,0 +1,34 @@
#include "test.hpp"
#include "check_integral_constant.hpp"
#include TYPE_TRAITS(is_function)
TT_TEST_BEGIN(is_function)
typedef void foo0_t();
typedef void foo1_t(int);
typedef void foo2_t(int&, double);
typedef void foo3_t(int&, bool, int, int);
typedef void foo4_t(int, bool, int*, int[], int, int, int, int, int);
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_function<foo0_t>::value, true);
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_function<foo1_t>::value, true);
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_function<foo2_t>::value, true);
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_function<foo3_t>::value, true);
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_function<foo4_t>::value, true);
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_function<void>::value, false);
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_function<int>::value, false);
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_function<int*>::value, false);
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_function<int[]>::value, false);
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_function<test_abc1>::value, false);
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_function<int (*)(int)>::value, false);
TT_TEST_END

View File

@@ -0,0 +1,143 @@
#include "test.hpp"
#include "check_integral_constant.hpp"
#include TYPE_TRAITS(is_fundamental)
TT_TEST_BEGIN(is_fundamental)
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_fundamental<void>::value, true);
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_fundamental<void const>::value, true);
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_fundamental<void volatile>::value, true);
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_fundamental<void const volatile>::value, true);
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_fundamental<bool>::value, true);
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_fundamental<bool const>::value, true);
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_fundamental<bool volatile>::value, true);
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_fundamental<bool const volatile>::value, true);
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_fundamental<signed char>::value, true);
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_fundamental<signed char const>::value, true);
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_fundamental<signed char volatile>::value, true);
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_fundamental<signed char const volatile>::value, true);
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_fundamental<unsigned char>::value, true);
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_fundamental<char>::value, true);
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_fundamental<unsigned char const>::value, true);
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_fundamental<char const>::value, true);
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_fundamental<unsigned char volatile>::value, true);
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_fundamental<char volatile>::value, true);
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_fundamental<unsigned char const volatile>::value, true);
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_fundamental<char const volatile>::value, true);
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_fundamental<unsigned short>::value, true);
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_fundamental<short>::value, true);
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_fundamental<unsigned short const>::value, true);
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_fundamental<short const>::value, true);
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_fundamental<unsigned short volatile>::value, true);
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_fundamental<short volatile>::value, true);
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_fundamental<unsigned short const volatile>::value, true);
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_fundamental<short const volatile>::value, true);
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_fundamental<unsigned int>::value, true);
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_fundamental<int>::value, true);
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_fundamental<unsigned int const>::value, true);
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_fundamental<int const>::value, true);
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_fundamental<unsigned int volatile>::value, true);
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_fundamental<int volatile>::value, true);
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_fundamental<unsigned int const volatile>::value, true);
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_fundamental<int const volatile>::value, true);
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_fundamental<unsigned long>::value, true);
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_fundamental<long>::value, true);
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_fundamental<unsigned long const>::value, true);
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_fundamental<long const>::value, true);
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_fundamental<unsigned long volatile>::value, true);
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_fundamental<long volatile>::value, true);
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_fundamental<unsigned long const volatile>::value, true);
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_fundamental<long const volatile>::value, true);
#ifdef BOOST_HAS_LONG_LONG
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_fundamental<unsigned long long>::value, true);
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_fundamental<long long>::value, true);
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_fundamental<unsigned long long const>::value, true);
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_fundamental<long long const>::value, true);
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_fundamental<unsigned long long volatile>::value, true);
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_fundamental<long long volatile>::value, true);
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_fundamental<unsigned long long const volatile>::value, true);
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_fundamental<long long const volatile>::value, true);
#endif
#ifdef BOOST_HAS_MS_INT64
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_fundamental<unsigned __int8>::value, true);
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_fundamental<__int8>::value, true);
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_fundamental<unsigned __int8 const>::value, true);
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_fundamental<__int8 const>::value, true);
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_fundamental<unsigned __int8 volatile>::value, true);
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_fundamental<__int8 volatile>::value, true);
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_fundamental<unsigned __int8 const volatile>::value, true);
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_fundamental<__int8 const volatile>::value, true);
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_fundamental<unsigned __int16>::value, true);
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_fundamental<__int16>::value, true);
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_fundamental<unsigned __int16 const>::value, true);
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_fundamental<__int16 const>::value, true);
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_fundamental<unsigned __int16 volatile>::value, true);
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_fundamental<__int16 volatile>::value, true);
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_fundamental<unsigned __int16 const volatile>::value, true);
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_fundamental<__int16 const volatile>::value, true);
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_fundamental<unsigned __int32>::value, true);
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_fundamental<__int32>::value, true);
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_fundamental<unsigned __int32 const>::value, true);
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_fundamental<__int32 const>::value, true);
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_fundamental<unsigned __int32 volatile>::value, true);
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_fundamental<__int32 volatile>::value, true);
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_fundamental<unsigned __int32 const volatile>::value, true);
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_fundamental<__int32 const volatile>::value, true);
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_fundamental<unsigned __int64>::value, true);
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_fundamental<__int64>::value, true);
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_fundamental<unsigned __int64 const>::value, true);
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_fundamental<__int64 const>::value, true);
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_fundamental<unsigned __int64 volatile>::value, true);
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_fundamental<__int64 volatile>::value, true);
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_fundamental<unsigned __int64 const volatile>::value, true);
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_fundamental<__int64 const volatile>::value, true);
#endif
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_fundamental<float>::value, true);
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_fundamental<float const>::value, true);
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_fundamental<float volatile>::value, true);
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_fundamental<float const volatile>::value, true);
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_fundamental<double>::value, true);
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_fundamental<double const>::value, true);
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_fundamental<double volatile>::value, true);
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_fundamental<double const volatile>::value, true);
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_fundamental<long double>::value, true);
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_fundamental<long double const>::value, true);
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_fundamental<long double volatile>::value, true);
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_fundamental<long double const volatile>::value, true);
//
// cases that should not be true:
//
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_fundamental<UDT>::value, false);
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_fundamental<test_abc1>::value, false);
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_fundamental<empty_UDT>::value, false);
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_fundamental<float*>::value, false);
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_fundamental<float&>::value, false);
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_fundamental<const float&>::value, false);
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_fundamental<float[2]>::value, false);
TT_TEST_END

125
test/is_integral_test.cpp Normal file
View File

@@ -0,0 +1,125 @@
#include "test.hpp"
#include "check_integral_constant.hpp"
#include TYPE_TRAITS(is_integral)
TT_TEST_BEGIN(is_integral)
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_integral<bool>::value, true);
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_integral<bool const>::value, true);
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_integral<bool volatile>::value, true);
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_integral<bool const volatile>::value, true);
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_integral<signed char>::value, true);
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_integral<signed char const>::value, true);
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_integral<signed char volatile>::value, true);
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_integral<signed char const volatile>::value, true);
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_integral<unsigned char>::value, true);
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_integral<char>::value, true);
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_integral<unsigned char const>::value, true);
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_integral<char const>::value, true);
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_integral<unsigned char volatile>::value, true);
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_integral<char volatile>::value, true);
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_integral<unsigned char const volatile>::value, true);
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_integral<char const volatile>::value, true);
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_integral<unsigned short>::value, true);
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_integral<short>::value, true);
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_integral<unsigned short const>::value, true);
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_integral<short const>::value, true);
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_integral<unsigned short volatile>::value, true);
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_integral<short volatile>::value, true);
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_integral<unsigned short const volatile>::value, true);
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_integral<short const volatile>::value, true);
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_integral<unsigned int>::value, true);
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_integral<int>::value, true);
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_integral<unsigned int const>::value, true);
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_integral<int const>::value, true);
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_integral<unsigned int volatile>::value, true);
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_integral<int volatile>::value, true);
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_integral<unsigned int const volatile>::value, true);
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_integral<int const volatile>::value, true);
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_integral<unsigned long>::value, true);
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_integral<long>::value, true);
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_integral<unsigned long const>::value, true);
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_integral<long const>::value, true);
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_integral<unsigned long volatile>::value, true);
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_integral<long volatile>::value, true);
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_integral<unsigned long const volatile>::value, true);
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_integral<long const volatile>::value, true);
#ifdef BOOST_HAS_LONG_LONG
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_integral<unsigned long long>::value, true);
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_integral<long long>::value, true);
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_integral<unsigned long long const>::value, true);
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_integral<long long const>::value, true);
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_integral<unsigned long long volatile>::value, true);
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_integral<long long volatile>::value, true);
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_integral<unsigned long long const volatile>::value, true);
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_integral<long long const volatile>::value, true);
#endif
#ifdef BOOST_HAS_MS_INT64
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_integral<unsigned __int8>::value, true);
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_integral<__int8>::value, true);
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_integral<unsigned __int8 const>::value, true);
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_integral<__int8 const>::value, true);
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_integral<unsigned __int8 volatile>::value, true);
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_integral<__int8 volatile>::value, true);
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_integral<unsigned __int8 const volatile>::value, true);
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_integral<__int8 const volatile>::value, true);
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_integral<unsigned __int16>::value, true);
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_integral<__int16>::value, true);
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_integral<unsigned __int16 const>::value, true);
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_integral<__int16 const>::value, true);
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_integral<unsigned __int16 volatile>::value, true);
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_integral<__int16 volatile>::value, true);
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_integral<unsigned __int16 const volatile>::value, true);
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_integral<__int16 const volatile>::value, true);
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_integral<unsigned __int32>::value, true);
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_integral<__int32>::value, true);
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_integral<unsigned __int32 const>::value, true);
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_integral<__int32 const>::value, true);
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_integral<unsigned __int32 volatile>::value, true);
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_integral<__int32 volatile>::value, true);
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_integral<unsigned __int32 const volatile>::value, true);
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_integral<__int32 const volatile>::value, true);
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_integral<unsigned __int64>::value, true);
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_integral<__int64>::value, true);
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_integral<unsigned __int64 const>::value, true);
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_integral<__int64 const>::value, true);
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_integral<unsigned __int64 volatile>::value, true);
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_integral<__int64 volatile>::value, true);
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_integral<unsigned __int64 const volatile>::value, true);
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_integral<__int64 const volatile>::value, true);
#endif
//
// cases that should not be true:
//
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_integral<void>::value, false);
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_integral<float>::value, false);
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_integral<UDT>::value, false);
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_integral<test_abc1>::value, false);
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_integral<empty_UDT>::value, false);
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_integral<int*>::value, false);
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_integral<int&>::value, false);
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_integral<const int&>::value, false);
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_integral<int[2]>::value, false);
TT_TEST_END

View File

@@ -0,0 +1,27 @@
#include "test.hpp"
#include "check_integral_constant.hpp"
#include TYPE_TRAITS(is_member_function_pointer)
TT_TEST_BEGIN(is_member_function_pointer)
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_member_function_pointer<f1>::value, false);
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_member_function_pointer<f2>::value, false);
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_member_function_pointer<f3>::value, false);
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_member_function_pointer<void*>::value, false);
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_member_function_pointer<mf1>::value, true);
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_member_function_pointer<mf2>::value, true);
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_member_function_pointer<mf3>::value, true);
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_member_function_pointer<mf4>::value, true);
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_member_function_pointer<cmf>::value, true);
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_member_function_pointer<mp>::value, false);
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_member_function_pointer<void>::value, false);
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_member_function_pointer<test_abc1>::value, false);
TT_TEST_END

View File

@@ -0,0 +1,27 @@
#include "test.hpp"
#include "check_integral_constant.hpp"
#include TYPE_TRAITS(is_member_pointer)
TT_TEST_BEGIN(is_member_pointer)
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_member_pointer<f1>::value, false);
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_member_pointer<f2>::value, false);
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_member_pointer<f3>::value, false);
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_member_pointer<void*>::value, false);
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_member_pointer<mf1>::value, true);
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_member_pointer<mf2>::value, true);
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_member_pointer<mf3>::value, true);
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_member_pointer<mf4>::value, true);
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_member_pointer<cmf>::value, true);
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_member_pointer<mp>::value, true);
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_member_pointer<void>::value, false);
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_member_pointer<test_abc1>::value, false);
TT_TEST_END

20
test/is_object_test.cpp Normal file
View File

@@ -0,0 +1,20 @@
#include "test.hpp"
#include "check_integral_constant.hpp"
#include TYPE_TRAITS(is_object)
TT_TEST_BEGIN(is_object)
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_object<int>::value, true);
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_object<UDT>::value, true);
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_object<int&>::value, false);
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_object<void>::value, false);
TT_TEST_END

150
test/is_pod_test.cpp Normal file
View File

@@ -0,0 +1,150 @@
#include "test.hpp"
#include "check_integral_constant.hpp"
#include TYPE_TRAITS(is_pod)
TT_TEST_BEGIN(is_pod)
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_POD<bool>::value, true);
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_POD<bool const>::value, true);
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_POD<bool volatile>::value, true);
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_POD<bool const volatile>::value, true);
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_POD<signed char>::value, true);
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_POD<signed char const>::value, true);
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_POD<signed char volatile>::value, true);
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_POD<signed char const volatile>::value, true);
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_POD<unsigned char>::value, true);
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_POD<char>::value, true);
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_POD<unsigned char const>::value, true);
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_POD<char const>::value, true);
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_POD<unsigned char volatile>::value, true);
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_POD<char volatile>::value, true);
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_POD<unsigned char const volatile>::value, true);
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_POD<char const volatile>::value, true);
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_POD<unsigned short>::value, true);
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_POD<short>::value, true);
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_POD<unsigned short const>::value, true);
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_POD<short const>::value, true);
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_POD<unsigned short volatile>::value, true);
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_POD<short volatile>::value, true);
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_POD<unsigned short const volatile>::value, true);
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_POD<short const volatile>::value, true);
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_POD<unsigned int>::value, true);
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_POD<int>::value, true);
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_POD<unsigned int const>::value, true);
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_POD<int const>::value, true);
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_POD<unsigned int volatile>::value, true);
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_POD<int volatile>::value, true);
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_POD<unsigned int const volatile>::value, true);
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_POD<int const volatile>::value, true);
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_POD<unsigned long>::value, true);
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_POD<long>::value, true);
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_POD<unsigned long const>::value, true);
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_POD<long const>::value, true);
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_POD<unsigned long volatile>::value, true);
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_POD<long volatile>::value, true);
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_POD<unsigned long const volatile>::value, true);
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_POD<long const volatile>::value, true);
#ifdef BOOST_HAS_LONG_LONG
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_POD<unsigned long long>::value, true);
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_POD<long long>::value, true);
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_POD<unsigned long long const>::value, true);
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_POD<long long const>::value, true);
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_POD<unsigned long long volatile>::value, true);
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_POD<long long volatile>::value, true);
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_POD<unsigned long long const volatile>::value, true);
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_POD<long long const volatile>::value, true);
#endif
#ifdef BOOST_HAS_MS_INT64
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_POD<unsigned __int8>::value, true);
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_POD<__int8>::value, true);
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_POD<unsigned __int8 const>::value, true);
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_POD<__int8 const>::value, true);
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_POD<unsigned __int8 volatile>::value, true);
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_POD<__int8 volatile>::value, true);
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_POD<unsigned __int8 const volatile>::value, true);
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_POD<__int8 const volatile>::value, true);
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_POD<unsigned __int16>::value, true);
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_POD<__int16>::value, true);
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_POD<unsigned __int16 const>::value, true);
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_POD<__int16 const>::value, true);
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_POD<unsigned __int16 volatile>::value, true);
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_POD<__int16 volatile>::value, true);
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_POD<unsigned __int16 const volatile>::value, true);
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_POD<__int16 const volatile>::value, true);
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_POD<unsigned __int32>::value, true);
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_POD<__int32>::value, true);
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_POD<unsigned __int32 const>::value, true);
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_POD<__int32 const>::value, true);
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_POD<unsigned __int32 volatile>::value, true);
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_POD<__int32 volatile>::value, true);
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_POD<unsigned __int32 const volatile>::value, true);
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_POD<__int32 const volatile>::value, true);
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_POD<unsigned __int64>::value, true);
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_POD<__int64>::value, true);
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_POD<unsigned __int64 const>::value, true);
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_POD<__int64 const>::value, true);
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_POD<unsigned __int64 volatile>::value, true);
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_POD<__int64 volatile>::value, true);
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_POD<unsigned __int64 const volatile>::value, true);
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_POD<__int64 const volatile>::value, true);
#endif
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_POD<float>::value, true);
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_POD<float const>::value, true);
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_POD<float volatile>::value, true);
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_POD<float const volatile>::value, true);
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_POD<double>::value, true);
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_POD<double const>::value, true);
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_POD<double volatile>::value, true);
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_POD<double const volatile>::value, true);
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_POD<long double>::value, true);
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_POD<long double const>::value, true);
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_POD<long double volatile>::value, true);
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_POD<long double const volatile>::value, true);
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_POD<int>::value, true);
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_POD<void*>::value, true);
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_POD<int*const>::value, true);
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_POD<f1>::value, true);
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_POD<f2>::value, true);
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_POD<f3>::value, true);
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_POD<mf1>::value, true);
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_POD<mf2>::value, true);
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_POD<mf3>::value, true);
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_POD<mp>::value, true);
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_POD<cmf>::value, true);
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_POD<enum_UDT>::value, true);
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_POD<int&>::value, false);
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_POD<const int&>::value, false);
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_POD<int[2]>::value, true);
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_POD<int[3][2]>::value, true);
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_POD<int[2][4][5][6][3]>::value, true);
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_POD<UDT>::value, false);
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_POD<empty_UDT>::value, false);
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_POD<void>::value, true);
TT_TEST_END

42
test/is_pointer_test.cpp Normal file
View File

@@ -0,0 +1,42 @@
#include "test.hpp"
#include "check_integral_constant.hpp"
#include TYPE_TRAITS(is_pointer)
TT_TEST_BEGIN(is_pointer)
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_pointer<int>::value, false);
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_pointer<int&>::value, false);
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_pointer<int*>::value, true);
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_pointer<const int*>::value, true);
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_pointer<volatile int*>::value, true);
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_pointer<non_pointer*>::value, true);
// these were false in previous versions (JM 20 Dec 2000):
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_pointer<int*const>::value, true);
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_pointer<int*volatile>::value, true);
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_pointer<int*const volatile>::value, true);
// JM 02 Oct 2000:
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_pointer<non_pointer>::value, false);
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_pointer<int*&>::value, false);
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_pointer<int(&)[2]>::value, false);
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_pointer<int[2]>::value, false);
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_pointer<char[sizeof(void*)]>::value, false);
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_pointer<void>::value, false);
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_pointer<f1>::value, true);
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_pointer<f2>::value, true);
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_pointer<f3>::value, true);
// Steve: was 'true', should be 'false', via 3.9.2p3
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_pointer<mf1>::value, false);
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_pointer<mf2>::value, false);
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_pointer<mf3>::value, false);
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_pointer<mf4>::value, false);
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_pointer<test_abc1>::value, false);
TT_TEST_END

View File

@@ -0,0 +1,30 @@
#include "test.hpp"
#include "check_integral_constant.hpp"
#include TYPE_TRAITS(is_reference)
TT_TEST_BEGIN(is_reference)
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_reference<int&>::value, true);
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_reference<const int&>::value, true);
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_reference<volatile int &>::value, true);
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_reference<const volatile int &>::value, true);
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_reference<r_type>::value, true);
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_reference<cr_type>::value, true);
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_reference<UDT&>::value, true);
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_reference<const UDT&>::value, true);
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_reference<volatile UDT&>::value, true);
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_reference<const volatile UDT&>::value, true);
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_reference<int (&)(int)>::value, true);
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_reference<int (&)[2]>::value, true);
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_reference<bool>::value, false);
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_reference<void>::value, false);
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_reference<test_abc1>::value, false);
TT_TEST_END

25
test/is_same_test.cpp Normal file
View File

@@ -0,0 +1,25 @@
#include "test.hpp"
#include "check_integral_constant.hpp"
#include TYPE_COMPARE(is_same)
TT_TEST_BEGIN(is_same)
BOOST_CHECK_INTEGRAL_CONSTANT((::tt::is_same<int, int>::value), true);
BOOST_CHECK_INTEGRAL_CONSTANT((::tt::is_same<int, const int>::value), false);
BOOST_CHECK_INTEGRAL_CONSTANT((::tt::is_same<int, int&>::value), false);
BOOST_CHECK_INTEGRAL_CONSTANT((::tt::is_same<const int, int&>::value), false);
BOOST_CHECK_INTEGRAL_CONSTANT((::tt::is_same<int, const int&>::value), false);
BOOST_CHECK_INTEGRAL_CONSTANT((::tt::is_same<int*, const int*>::value), false);
BOOST_CHECK_INTEGRAL_CONSTANT((::tt::is_same<int*, int*const>::value), false);
BOOST_CHECK_INTEGRAL_CONSTANT((::tt::is_same<int, int[2]>::value), false);
BOOST_CHECK_INTEGRAL_CONSTANT((::tt::is_same<int*, int[2]>::value), false);
BOOST_CHECK_INTEGRAL_CONSTANT((::tt::is_same<int[4], int[2]>::value), false);
TT_TEST_END

145
test/is_scalar_test.cpp Normal file
View File

@@ -0,0 +1,145 @@
#include "test.hpp"
#include "check_integral_constant.hpp"
#include TYPE_TRAITS(is_scalar)
TT_TEST_BEGIN(is_scalar)
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_scalar<bool>::value, true);
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_scalar<bool const>::value, true);
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_scalar<bool volatile>::value, true);
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_scalar<bool const volatile>::value, true);
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_scalar<signed char>::value, true);
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_scalar<signed char const>::value, true);
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_scalar<signed char volatile>::value, true);
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_scalar<signed char const volatile>::value, true);
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_scalar<unsigned char>::value, true);
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_scalar<char>::value, true);
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_scalar<unsigned char const>::value, true);
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_scalar<char const>::value, true);
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_scalar<unsigned char volatile>::value, true);
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_scalar<char volatile>::value, true);
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_scalar<unsigned char const volatile>::value, true);
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_scalar<char const volatile>::value, true);
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_scalar<unsigned short>::value, true);
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_scalar<short>::value, true);
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_scalar<unsigned short const>::value, true);
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_scalar<short const>::value, true);
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_scalar<unsigned short volatile>::value, true);
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_scalar<short volatile>::value, true);
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_scalar<unsigned short const volatile>::value, true);
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_scalar<short const volatile>::value, true);
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_scalar<unsigned int>::value, true);
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_scalar<int>::value, true);
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_scalar<unsigned int const>::value, true);
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_scalar<int const>::value, true);
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_scalar<unsigned int volatile>::value, true);
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_scalar<int volatile>::value, true);
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_scalar<unsigned int const volatile>::value, true);
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_scalar<int const volatile>::value, true);
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_scalar<unsigned long>::value, true);
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_scalar<long>::value, true);
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_scalar<unsigned long const>::value, true);
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_scalar<long const>::value, true);
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_scalar<unsigned long volatile>::value, true);
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_scalar<long volatile>::value, true);
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_scalar<unsigned long const volatile>::value, true);
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_scalar<long const volatile>::value, true);
#ifdef BOOST_HAS_LONG_LONG
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_scalar<unsigned long long>::value, true);
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_scalar<long long>::value, true);
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_scalar<unsigned long long const>::value, true);
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_scalar<long long const>::value, true);
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_scalar<unsigned long long volatile>::value, true);
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_scalar<long long volatile>::value, true);
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_scalar<unsigned long long const volatile>::value, true);
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_scalar<long long const volatile>::value, true);
#endif
#ifdef BOOST_HAS_MS_INT64
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_scalar<unsigned __int8>::value, true);
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_scalar<__int8>::value, true);
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_scalar<unsigned __int8 const>::value, true);
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_scalar<__int8 const>::value, true);
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_scalar<unsigned __int8 volatile>::value, true);
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_scalar<__int8 volatile>::value, true);
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_scalar<unsigned __int8 const volatile>::value, true);
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_scalar<__int8 const volatile>::value, true);
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_scalar<unsigned __int16>::value, true);
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_scalar<__int16>::value, true);
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_scalar<unsigned __int16 const>::value, true);
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_scalar<__int16 const>::value, true);
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_scalar<unsigned __int16 volatile>::value, true);
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_scalar<__int16 volatile>::value, true);
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_scalar<unsigned __int16 const volatile>::value, true);
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_scalar<__int16 const volatile>::value, true);
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_scalar<unsigned __int32>::value, true);
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_scalar<__int32>::value, true);
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_scalar<unsigned __int32 const>::value, true);
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_scalar<__int32 const>::value, true);
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_scalar<unsigned __int32 volatile>::value, true);
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_scalar<__int32 volatile>::value, true);
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_scalar<unsigned __int32 const volatile>::value, true);
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_scalar<__int32 const volatile>::value, true);
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_scalar<unsigned __int64>::value, true);
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_scalar<__int64>::value, true);
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_scalar<unsigned __int64 const>::value, true);
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_scalar<__int64 const>::value, true);
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_scalar<unsigned __int64 volatile>::value, true);
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_scalar<__int64 volatile>::value, true);
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_scalar<unsigned __int64 const volatile>::value, true);
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_scalar<__int64 const volatile>::value, true);
#endif
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_scalar<float>::value, true);
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_scalar<float const>::value, true);
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_scalar<float volatile>::value, true);
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_scalar<float const volatile>::value, true);
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_scalar<double>::value, true);
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_scalar<double const>::value, true);
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_scalar<double volatile>::value, true);
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_scalar<double const volatile>::value, true);
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_scalar<long double>::value, true);
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_scalar<long double const>::value, true);
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_scalar<long double volatile>::value, true);
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_scalar<long double const volatile>::value, true);
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_scalar<int>::value, true);
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_scalar<void*>::value, true);
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_scalar<int*const>::value, true);
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_scalar<f1>::value, true);
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_scalar<f2>::value, true);
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_scalar<f3>::value, true);
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_scalar<mf1>::value, true);
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_scalar<mf2>::value, true);
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_scalar<mf3>::value, true);
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_scalar<mp>::value, true);
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_scalar<cmf>::value, true);
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_scalar<enum_UDT>::value, true);
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_scalar<void>::value, false);
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_scalar<UDT>::value, false);
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_scalar<int&>::value, false);
TT_TEST_END

46
test/is_union_test.cpp Normal file
View File

@@ -0,0 +1,46 @@
#include "test.hpp"
#include "check_integral_constant.hpp"
#include TYPE_TRAITS(is_union)
TT_TEST_BEGIN(is_union)
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_union<int>::value, false);
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_union<const int>::value, false);
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_union<volatile int>::value, false);
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_union<int*>::value, false);
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_union<int* const>::value, false);
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_union<int[2]>::value, false);
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_union<int&>::value, false);
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_union<mf4>::value, false);
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_union<f1>::value, false);
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_union<enum_UDT>::value, false);
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_union<union_UDT>::value, true);
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_union<POD_union_UDT>::value, true);
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_union<empty_union_UDT>::value, true);
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_union<empty_POD_union_UDT>::value, true);
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_union<union_UDT const>::value, true);
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_union<POD_union_UDT volatile>::value, true);
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_union<empty_union_UDT const volatile>::value, true);
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_union<empty_POD_union_UDT const>::value, true);
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_union<UDT>::value, false);
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_union<UDT const>::value, false);
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_union<UDT volatile>::value, false);
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_union<empty_UDT>::value, false);
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_union<std::iostream>::value, false);
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_union<UDT*>::value, false);
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_union<UDT[2]>::value, false);
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_union<UDT&>::value, false);
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_union<void>::value, false);
TT_TEST_END

23
test/is_void_test.cpp Normal file
View File

@@ -0,0 +1,23 @@
#include "test.hpp"
#include "check_integral_constant.hpp"
#include TYPE_TRAITS(is_void)
TT_TEST_BEGIN(is_void)
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_void<void>::value, true);
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_void<void const>::value, true);
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_void<void volatile>::value, true);
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_void<void const volatile>::value, true);
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_void<void*>::value, false);
BOOST_CHECK_INTEGRAL_CONSTANT(::boost::is_void<int>::value, false);
BOOST_CHECK_INTEGRAL_CONSTANT(::boost::is_void<test_abc1>::value, false);
TT_TEST_END

23
test/is_volatile_test.cpp Normal file
View File

@@ -0,0 +1,23 @@
#include "test.hpp"
#include "check_integral_constant.hpp"
#include TYPE_TRAITS(is_volatile)
TT_TEST_BEGIN(is_volatile)
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_volatile<void>::value, false);
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_volatile<volatile void>::value, true);
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_volatile<test_abc1>::value, false);
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_volatile<volatile test_abc1>::value, true);
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_volatile<int>::value, false);
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_volatile<volatile int>::value, true);
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_volatile<volatile UDT>::value, true);
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_volatile<volatile const UDT>::value, true);
TT_TEST_END

View File

@@ -0,0 +1,42 @@
#include "test.hpp"
#include "check_type.hpp"
#include TYPE_TRANSFORM(remove_bounds)
BOOST_DECL_TRANSFORM_TEST(remove_bounds_test_1, ::boost::remove_bounds, const, const)
BOOST_DECL_TRANSFORM_TEST(remove_bounds_test_2, ::boost::remove_bounds, volatile, volatile)
BOOST_DECL_TRANSFORM_TEST3(remove_bounds_test_3, ::boost::remove_bounds, [2])
BOOST_DECL_TRANSFORM_TEST0(remove_bounds_test_4, ::boost::remove_bounds)
BOOST_DECL_TRANSFORM_TEST(remove_bounds_test_5, ::boost::remove_bounds, const &, const&)
BOOST_DECL_TRANSFORM_TEST(remove_bounds_test_6, ::boost::remove_bounds, *, *)
BOOST_DECL_TRANSFORM_TEST(remove_bounds_test_7, ::boost::remove_bounds, *volatile, *volatile)
BOOST_DECL_TRANSFORM_TEST(remove_bounds_test_8, ::boost::remove_bounds, const [2], const)
BOOST_DECL_TRANSFORM_TEST(remove_bounds_test_9, ::boost::remove_bounds, const &, const&)
BOOST_DECL_TRANSFORM_TEST(remove_bounds_test_10, ::boost::remove_bounds, const*, const*)
BOOST_DECL_TRANSFORM_TEST(remove_bounds_test_11, ::boost::remove_bounds, volatile*, volatile*)
BOOST_DECL_TRANSFORM_TEST(remove_bounds_test_12, ::boost::remove_bounds, const[2][3], const[3])
BOOST_DECL_TRANSFORM_TEST(remove_bounds_test_13, ::boost::remove_bounds, (&)[2], (&)[2])
TT_TEST_BEGIN(remove_bounds)
remove_bounds_test_1();
remove_bounds_test_2();
remove_bounds_test_3();
remove_bounds_test_4();
remove_bounds_test_5();
remove_bounds_test_6();
remove_bounds_test_7();
remove_bounds_test_8();
remove_bounds_test_9();
remove_bounds_test_10();
remove_bounds_test_11();
remove_bounds_test_12();
remove_bounds_test_13();
TT_TEST_END

View File

@@ -0,0 +1,48 @@
#include "test.hpp"
#include "check_type.hpp"
#include TYPE_TRANSFORM(remove_const)
BOOST_DECL_TRANSFORM_TEST3(remove_const_test_1, ::boost::remove_const, const)
BOOST_DECL_TRANSFORM_TEST(remove_const_test_2, ::boost::remove_const, volatile, volatile)
BOOST_DECL_TRANSFORM_TEST(remove_const_test_3, ::boost::remove_const, const volatile, volatile)
BOOST_DECL_TRANSFORM_TEST0(remove_const_test_4, ::boost::remove_const)
BOOST_DECL_TRANSFORM_TEST(remove_const_test_6, ::boost::remove_const, *const, *)
BOOST_DECL_TRANSFORM_TEST(remove_const_test_7, ::boost::remove_const, *volatile, *volatile)
BOOST_DECL_TRANSFORM_TEST(remove_const_test_8, ::boost::remove_const, *const volatile, *volatile)
BOOST_DECL_TRANSFORM_TEST(remove_const_test_9, ::boost::remove_const, *, *)
BOOST_DECL_TRANSFORM_TEST(remove_const_test_11, ::boost::remove_const, volatile*, volatile*)
BOOST_DECL_TRANSFORM_TEST(remove_const_test_12, ::boost::remove_const, const[2], [2])
BOOST_DECL_TRANSFORM_TEST(remove_const_test_13, ::boost::remove_const, volatile[2], volatile[2])
BOOST_DECL_TRANSFORM_TEST(remove_const_test_14, ::boost::remove_const, const volatile[2], volatile[2])
BOOST_DECL_TRANSFORM_TEST(remove_const_test_15, ::boost::remove_const, [2], [2])
BOOST_DECL_TRANSFORM_TEST(remove_const_test_16, ::boost::remove_const, const*, const*)
BOOST_DECL_TRANSFORM_TEST(remove_const_test_17, ::boost::remove_const, const*const, const*)
TT_TEST_BEGIN(remove_const)
BOOST_CHECK_TYPE(int, int);
remove_const_test_1();
remove_const_test_2();
remove_const_test_3();
remove_const_test_4();
remove_const_test_6();
remove_const_test_7();
remove_const_test_8();
remove_const_test_9();
remove_const_test_11();
remove_const_test_12();
remove_const_test_13();
remove_const_test_14();
remove_const_test_15();
remove_const_test_16();
remove_const_test_17();
TT_TEST_END

50
test/remove_cv_test.cpp Normal file
View File

@@ -0,0 +1,50 @@
#include "test.hpp"
#include "check_type.hpp"
#include TYPE_TRANSFORM(remove_cv)
BOOST_DECL_TRANSFORM_TEST3(remove_cv_test_1, ::boost::remove_cv, const)
BOOST_DECL_TRANSFORM_TEST3(remove_cv_test_2, ::boost::remove_cv, volatile)
BOOST_DECL_TRANSFORM_TEST3(remove_cv_test_3, ::boost::remove_cv, const volatile)
BOOST_DECL_TRANSFORM_TEST0(remove_cv_test_4, ::boost::remove_cv)
BOOST_DECL_TRANSFORM_TEST(remove_cv_test_5, ::boost::remove_cv, const &, const&)
BOOST_DECL_TRANSFORM_TEST(remove_cv_test_6, ::boost::remove_cv, *const, *)
BOOST_DECL_TRANSFORM_TEST(remove_cv_test_7, ::boost::remove_cv, *volatile, *)
BOOST_DECL_TRANSFORM_TEST(remove_cv_test_8, ::boost::remove_cv, *const volatile, *)
BOOST_DECL_TRANSFORM_TEST(remove_cv_test_9, ::boost::remove_cv, *, *)
BOOST_DECL_TRANSFORM_TEST(remove_cv_test_10, ::boost::remove_cv, const*, const*)
BOOST_DECL_TRANSFORM_TEST(remove_cv_test_11, ::boost::remove_cv, volatile*, volatile*)
BOOST_DECL_TRANSFORM_TEST(remove_cv_test_12, ::boost::remove_cv, const[2], [2])
BOOST_DECL_TRANSFORM_TEST(remove_cv_test_13, ::boost::remove_cv, volatile[2], [2])
BOOST_DECL_TRANSFORM_TEST(remove_cv_test_14, ::boost::remove_cv, const volatile[2], [2])
BOOST_DECL_TRANSFORM_TEST(remove_cv_test_15, ::boost::remove_cv, [2], [2])
BOOST_DECL_TRANSFORM_TEST(remove_cv_test_16, ::boost::remove_cv, const*, const*)
BOOST_DECL_TRANSFORM_TEST(remove_cv_test_17, ::boost::remove_cv, const*volatile, const*)
TT_TEST_BEGIN(remove_cv)
remove_cv_test_1();
remove_cv_test_2();
remove_cv_test_3();
remove_cv_test_4();
remove_cv_test_5();
remove_cv_test_6();
remove_cv_test_7();
remove_cv_test_8();
remove_cv_test_9();
remove_cv_test_10();
remove_cv_test_11();
remove_cv_test_12();
remove_cv_test_13();
remove_cv_test_14();
remove_cv_test_15();
remove_cv_test_16();
remove_cv_test_17();
TT_TEST_END

View File

@@ -0,0 +1,42 @@
#include "test.hpp"
#include "check_type.hpp"
#include TYPE_TRANSFORM(remove_pointer)
BOOST_DECL_TRANSFORM_TEST(remove_pointer_test_1, ::boost::remove_pointer, const, const)
BOOST_DECL_TRANSFORM_TEST(remove_pointer_test_2, ::boost::remove_pointer, volatile, volatile)
BOOST_DECL_TRANSFORM_TEST3(remove_pointer_test_3, ::boost::remove_pointer, *)
BOOST_DECL_TRANSFORM_TEST0(remove_pointer_test_4, ::boost::remove_pointer)
BOOST_DECL_TRANSFORM_TEST(remove_pointer_test_5, ::boost::remove_pointer, const &, const&)
BOOST_DECL_TRANSFORM_TEST(remove_pointer_test_6, ::boost::remove_pointer, &, &)
BOOST_DECL_TRANSFORM_TEST3(remove_pointer_test_7, ::boost::remove_pointer, *volatile)
BOOST_DECL_TRANSFORM_TEST(remove_pointer_test_8, ::boost::remove_pointer, const [2], const[2])
BOOST_DECL_TRANSFORM_TEST(remove_pointer_test_9, ::boost::remove_pointer, const &, const&)
BOOST_DECL_TRANSFORM_TEST(remove_pointer_test_10, ::boost::remove_pointer, const*, const)
BOOST_DECL_TRANSFORM_TEST(remove_pointer_test_11, ::boost::remove_pointer, volatile*, volatile)
BOOST_DECL_TRANSFORM_TEST(remove_pointer_test_12, ::boost::remove_pointer, const[2][3], const[2][3])
BOOST_DECL_TRANSFORM_TEST(remove_pointer_test_13, ::boost::remove_pointer, (&)[2], (&)[2])
TT_TEST_BEGIN(remove_pointer)
remove_pointer_test_1();
remove_pointer_test_2();
remove_pointer_test_3();
remove_pointer_test_4();
remove_pointer_test_5();
remove_pointer_test_6();
remove_pointer_test_7();
remove_pointer_test_8();
remove_pointer_test_9();
remove_pointer_test_10();
remove_pointer_test_11();
remove_pointer_test_12();
remove_pointer_test_13();
TT_TEST_END

View File

@@ -0,0 +1,42 @@
#include "test.hpp"
#include "check_type.hpp"
#include TYPE_TRANSFORM(remove_reference)
BOOST_DECL_TRANSFORM_TEST(remove_reference_test_1, ::boost::remove_reference, const, const)
BOOST_DECL_TRANSFORM_TEST(remove_reference_test_2, ::boost::remove_reference, volatile, volatile)
BOOST_DECL_TRANSFORM_TEST3(remove_reference_test_3, ::boost::remove_reference, &)
BOOST_DECL_TRANSFORM_TEST0(remove_reference_test_4, ::boost::remove_reference)
BOOST_DECL_TRANSFORM_TEST(remove_reference_test_5, ::boost::remove_reference, const &, const)
BOOST_DECL_TRANSFORM_TEST(remove_reference_test_6, ::boost::remove_reference, *, *)
BOOST_DECL_TRANSFORM_TEST(remove_reference_test_7, ::boost::remove_reference, *volatile, *volatile)
BOOST_DECL_TRANSFORM_TEST3(remove_reference_test_8, ::boost::remove_reference, &)
BOOST_DECL_TRANSFORM_TEST(remove_reference_test_9, ::boost::remove_reference, const &, const)
BOOST_DECL_TRANSFORM_TEST(remove_reference_test_10, ::boost::remove_reference, const*, const*)
BOOST_DECL_TRANSFORM_TEST(remove_reference_test_11, ::boost::remove_reference, volatile*, volatile*)
BOOST_DECL_TRANSFORM_TEST(remove_reference_test_12, ::boost::remove_reference, const[2], const[2])
BOOST_DECL_TRANSFORM_TEST(remove_reference_test_13, ::boost::remove_reference, (&)[2], [2])
TT_TEST_BEGIN(remove_reference)
remove_reference_test_1();
remove_reference_test_2();
remove_reference_test_3();
remove_reference_test_4();
remove_reference_test_5();
remove_reference_test_6();
remove_reference_test_7();
remove_reference_test_8();
remove_reference_test_9();
remove_reference_test_10();
remove_reference_test_11();
remove_reference_test_12();
remove_reference_test_13();
TT_TEST_END

View File

@@ -0,0 +1,50 @@
#include "test.hpp"
#include "check_type.hpp"
#include TYPE_TRANSFORM(remove_volatile)
BOOST_DECL_TRANSFORM_TEST(remove_volatile_test_1, ::boost::remove_volatile, const, const)
BOOST_DECL_TRANSFORM_TEST3(remove_volatile_test_2, ::boost::remove_volatile, volatile)
BOOST_DECL_TRANSFORM_TEST(remove_volatile_test_3, ::boost::remove_volatile, const volatile, const)
BOOST_DECL_TRANSFORM_TEST0(remove_volatile_test_4, ::boost::remove_volatile)
BOOST_DECL_TRANSFORM_TEST0(remove_volatile_test_5, ::boost::remove_volatile)
BOOST_DECL_TRANSFORM_TEST(remove_volatile_test_6, ::boost::remove_volatile, *const, *const)
BOOST_DECL_TRANSFORM_TEST(remove_volatile_test_7, ::boost::remove_volatile, *volatile, *)
BOOST_DECL_TRANSFORM_TEST(remove_volatile_test_8, ::boost::remove_volatile, *const volatile, *const)
BOOST_DECL_TRANSFORM_TEST(remove_volatile_test_9, ::boost::remove_volatile, *, *)
BOOST_DECL_TRANSFORM_TEST(remove_volatile_test_10, ::boost::remove_volatile, *, *)
BOOST_DECL_TRANSFORM_TEST(remove_volatile_test_11, ::boost::remove_volatile, volatile*, volatile*)
BOOST_DECL_TRANSFORM_TEST(remove_volatile_test_12, ::boost::remove_volatile, const[2], const[2])
BOOST_DECL_TRANSFORM_TEST(remove_volatile_test_13, ::boost::remove_volatile, volatile[2], [2])
BOOST_DECL_TRANSFORM_TEST(remove_volatile_test_14, ::boost::remove_volatile, const volatile[2], const[2])
BOOST_DECL_TRANSFORM_TEST(remove_volatile_test_15, ::boost::remove_volatile, [2], [2])
BOOST_DECL_TRANSFORM_TEST(remove_volatile_test_16, ::boost::remove_volatile, const*, const*)
BOOST_DECL_TRANSFORM_TEST(remove_volatile_test_17, ::boost::remove_volatile, const*volatile, const*)
TT_TEST_BEGIN(remove_volatile)
remove_volatile_test_1();
remove_volatile_test_2();
remove_volatile_test_3();
remove_volatile_test_4();
remove_volatile_test_5();
remove_volatile_test_6();
remove_volatile_test_7();
remove_volatile_test_8();
remove_volatile_test_9();
remove_volatile_test_10();
remove_volatile_test_11();
remove_volatile_test_12();
remove_volatile_test_13();
remove_volatile_test_14();
remove_volatile_test_15();
remove_volatile_test_16();
remove_volatile_test_17();
TT_TEST_END

249
test/test.hpp Normal file
View File

@@ -0,0 +1,249 @@
#ifndef TT_TEST_HPP
#define TT_TEST_HPP
#include <boost/test/unit_test.hpp>
//
// basic configuration:
//
#ifdef TEST_STD
#define tt std
#define TYPE_TRAITS(x) <type_traits>
#define TYPE_COMPARE(x) <type_compare>
#define TYPE_TRANSFORM(x) <type_transform>
#else
#define tt boost
#define TYPE_TRAITS(x) BOOST_STRINGIZE(boost/type_traits/x.hpp)
#define TYPE_COMPARE(x) BOOST_STRINGIZE(boost/type_traits/x.hpp)
#define TYPE_TRANSFORM(x) BOOST_STRINGIZE(boost/type_traits/x.hpp)
#endif
//
// global unit, this is not safe, but until the unit test framework uses
// shared_ptr throughout this is about as good as it gets :-(
//
boost::unit_test_framework::test_suite* get_master_unit(const char* name = 0);
//
// initialisation class:
//
class unit_initialiser
{
public:
unit_initialiser(void (*f)(), const char* name)
{
get_master_unit("Type Traits")->add( ::boost::unit_test_framework::create_test_case(f, name) );
}
};
#define TT_TEST_BEGIN(trait_name)\
namespace{\
void trait_name();\
unit_initialiser init(trait_name, BOOST_STRINGIZE(trait_name));\
void trait_name(){
#define TT_TEST_END }}
#define TRANSFORM_CHECK(name, from_suffix, to_suffix)\
BOOST_CHECK_TYPE(bool to_suffix, name<bool from_suffix>::type);\
BOOST_CHECK_TYPE(char to_suffix, name<char from_suffix>::type);\
BOOST_CHECK_TYPE(wchar_t to_suffix, name<wchar_t from_suffix>::type);\
BOOST_CHECK_TYPE(signed char to_suffix, name<signed char from_suffix>::type);\
BOOST_CHECK_TYPE(unsigned char to_suffix, name<unsigned char from_suffix>::type);\
BOOST_CHECK_TYPE(short to_suffix, name<short from_suffix>::type);\
BOOST_CHECK_TYPE(unsigned short to_suffix, name<unsigned short from_suffix>::type);\
BOOST_CHECK_TYPE(int to_suffix, name<int from_suffix>::type);\
BOOST_CHECK_TYPE(unsigned int to_suffix, name<unsigned int from_suffix>::type);\
BOOST_CHECK_TYPE(long to_suffix, name<long from_suffix>::type);\
BOOST_CHECK_TYPE(unsigned long to_suffix, name<unsigned long from_suffix>::type);\
BOOST_CHECK_TYPE(float to_suffix, name<float from_suffix>::type);\
BOOST_CHECK_TYPE(long double to_suffix, name<long double from_suffix>::type);\
BOOST_CHECK_TYPE(double to_suffix, name<double from_suffix>::type);\
BOOST_CHECK_TYPE(UDT to_suffix, name<UDT from_suffix>::type);\
BOOST_CHECK_TYPE(enum1 to_suffix, name<enum1 from_suffix>::type);
#define BOOST_DUMMY_MACRO_PARAM /**/
#define BOOST_DECL_TRANSFORM_TEST(name, type, from, to)\
void name(){ TRANSFORM_CHECK(type, from, to) }
#define BOOST_DECL_TRANSFORM_TEST3(name, type, from)\
void name(){ TRANSFORM_CHECK(type, from, BOOST_DUMMY_MACRO_PARAM) }
#define BOOST_DECL_TRANSFORM_TEST2(name, type, to)\
void name(){ TRANSFORM_CHECK(type, BOOST_DUMMY_MACRO_PARAM, to) }
#define BOOST_DECL_TRANSFORM_TEST0(name, type)\
void name(){ TRANSFORM_CHECK(type, BOOST_DUMMY_MACRO_PARAM, BOOST_DUMMY_MACRO_PARAM) }
//
// VC++ emits an awful lot of warnings unless we define these:
#ifdef BOOST_MSVC
# pragma warning(disable:4800)
#endif
//
// define some test types:
//
enum enum_UDT{ one, two, three };
struct UDT
{
UDT(){};
~UDT(){};
UDT(const UDT&);
UDT& operator=(const UDT&);
int i;
void f1();
int f2();
int f3(int);
int f4(int, float);
};
typedef void(*f1)();
typedef int(*f2)(int);
typedef int(*f3)(int, bool);
typedef void (UDT::*mf1)();
typedef int (UDT::*mf2)();
typedef int (UDT::*mf3)(int);
typedef int (UDT::*mf4)(int, float);
typedef int (UDT::*mp);
typedef int (UDT::*cmf)(int) const;
// cv-qualifiers applied to reference types should have no effect
// declare these here for later use with is_reference and remove_reference:
# ifdef BOOST_MSVC
# pragma warning(push)
# pragma warning(disable: 4181)
# elif defined(__ICL)
# pragma warning(push)
# pragma warning(disable: 21)
# endif
//
// This is intentional:
// r_type and cr_type should be the same type
// but some compilers wrongly apply cv-qualifiers
// to reference types (this may generate a warning
// on some compilers):
//
typedef int& r_type;
typedef const r_type cr_type;
# ifdef BOOST_MSVC
# pragma warning(pop)
# elif defined(__ICL)
# pragma warning(pop)
# pragma warning(disable: 985) // identifier truncated in debug information
# endif
struct POD_UDT { int x; };
struct empty_UDT
{
~empty_UDT(){};
empty_UDT& operator=(const empty_UDT&){ return *this; }
bool operator==(const empty_UDT&)const
{ return true; }
};
struct empty_POD_UDT
{
empty_POD_UDT& operator=(const empty_POD_UDT&){ return *this; }
bool operator==(const empty_POD_UDT&)const
{ return true; }
};
union union_UDT
{
int x;
double y;
~union_UDT(){}
};
union POD_union_UDT
{
int x;
double y;
};
union empty_union_UDT
{
~empty_union_UDT(){}
};
union empty_POD_union_UDT{};
class Base { };
class Derived : public Base { };
class NonDerived { };
enum enum1
{
one_,two_
};
enum enum2
{
three_,four_
};
struct VB
{
virtual ~VB(){};
};
struct VD : VB
{
~VD(){};
};
//
// struct non_pointer:
// used to verify that is_pointer does not return
// true for class types that implement operator void*()
//
struct non_pointer
{
operator void*(){return this;}
};
struct non_int_pointer
{
int i;
operator int*(){return &i;}
};
struct int_constructible
{
int_constructible(int);
};
struct int_convertible
{
operator int();
};
//
// struct non_empty:
// used to verify that is_empty does not emit
// spurious warnings or errors.
//
struct non_empty : private boost::noncopyable
{
int i;
};
//
// abstract base classes:
struct test_abc1
{
virtual void foo() = 0;
virtual void foo2() = 0;
};
struct test_abc2
{
virtual void foo() = 0;
virtual void foo2() = 0;
};
struct incomplete_type;
#endif

View File

@@ -0,0 +1,61 @@
#include "test.hpp"
#include "check_integral_constant.hpp"
#include TYPE_TRAITS(is_function)
#include TYPE_TRAITS(is_pointer)
#include TYPE_TRAITS(is_void)
#include TYPE_TRAITS(is_integral)
#include TYPE_TRAITS(is_float)
#include TYPE_TRAITS(is_arithmetic)
#include TYPE_TRAITS(is_fundamental)
#include TYPE_TRAITS(is_member_pointer)
#include TYPE_TRAITS(is_enum)
#include TYPE_TRAITS(is_object)
#include TYPE_TRAITS(is_scalar)
#include TYPE_TRAITS(is_class)
#include TYPE_TRAITS(is_POD)
#include TYPE_TRAITS(has_trivial_constructor)
#include TYPE_TRAITS(has_trivial_copy)
#include TYPE_TRAITS(has_trivial_assign)
#include TYPE_TRAITS(has_nothrow_constructor)
#include TYPE_TRAITS(has_nothrow_copy)
#include TYPE_TRAITS(has_nothrow_assign)
#include TYPE_TRAITS(has_trivial_destructor)
#include TYPE_TRAITS(is_empty)
#include TYPE_TRAITS(is_compound)
TT_TEST_BEGIN(abstract_type_tricky_tests)
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_pointer<test_abc1>::value, false);
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_function<test_abc1>::value, false);
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_void<test_abc1>::value, false);
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_integral<test_abc1>::value, false);
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_float<test_abc1>::value, false);
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_arithmetic<test_abc1>::value, false);
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_fundamental<test_abc1>::value, false);
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_reference<test_abc1>::value, false);
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_member_pointer<test_abc1>::value, false);
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_enum<test_abc1>::value, false);
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_union<test_abc1>::value, false);
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_object<test_abc1>::value, true);
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_scalar<test_abc1>::value, false);
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_class<test_abc1>::value, true);
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_class<test_abc1 const>::value, true);
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_compound<test_abc1>::value, true);
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_POD<test_abc1>::value, false);
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_constructor<test_abc1>::value, false);
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_copy<test_abc1>::value, false);
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_assign<test_abc1>::value, false);
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_destructor<test_abc1>::value, false);
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_empty<test_abc1>::value, false);
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_nothrow_assign<test_abc1>::value, false);
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_nothrow_constructor<test_abc1>::value, false);
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_nothrow_copy<test_abc1>::value, false);
TT_TEST_END

View File

@@ -0,0 +1,29 @@
#include "test.hpp"
#include "check_type.hpp"
#include TYPE_TRANSFORM(add_pointer)
BOOST_DECL_TRANSFORM_TEST(add_pointer_test_5, ::boost::add_pointer, const &, const*)
BOOST_DECL_TRANSFORM_TEST(add_pointer_test_6, ::boost::add_pointer, &, *)
BOOST_DECL_TRANSFORM_TEST(add_pointer_test_8, ::boost::add_pointer, const [2], const (*)[2])
BOOST_DECL_TRANSFORM_TEST(add_pointer_test_9, ::boost::add_pointer, const &, const*)
BOOST_DECL_TRANSFORM_TEST(add_pointer_test_12, ::boost::add_pointer, const[2][3], const (*)[2][3])
BOOST_DECL_TRANSFORM_TEST(add_pointer_test_13, ::boost::add_pointer, (&)[2], (*)[2])
TT_TEST_BEGIN(partial_specialization_tricky_tests)
add_pointer_test_5();
add_pointer_test_6();
add_pointer_test_8();
add_pointer_test_9();
add_pointer_test_12();
add_pointer_test_13();
TT_TEST_END

View File

@@ -0,0 +1,147 @@
#include "test.hpp"
#include "check_integral_constant.hpp"
#include TYPE_TRAITS(is_function)
#include TYPE_TRAITS(is_pointer)
#include TYPE_TRAITS(is_void)
#include TYPE_TRAITS(is_integral)
#include TYPE_TRAITS(is_float)
#include TYPE_TRAITS(is_arithmetic)
#include TYPE_TRAITS(is_fundamental)
#include TYPE_TRAITS(is_member_pointer)
#include TYPE_TRAITS(is_enum)
#include TYPE_TRAITS(is_object)
#include TYPE_TRAITS(is_scalar)
#include TYPE_TRAITS(is_class)
#include TYPE_TRAITS(is_POD)
#include TYPE_TRAITS(has_trivial_constructor)
#include TYPE_TRAITS(has_trivial_copy)
#include TYPE_TRAITS(has_trivial_assign)
#include TYPE_TRAITS(has_trivial_destructor)
#include TYPE_TRAITS(is_empty)
#include TYPE_TRAITS(is_compound)
typedef void foo0_t();
typedef void foo1_t(int);
typedef void foo2_t(int&, double);
typedef void foo3_t(int&, bool, int, int);
typedef void foo4_t(int, bool, int*, int[], int, int, int, int, int);
TT_TEST_BEGIN(is_function)
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_function<const int&>::value, false);
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_function<int (&)(int)>::value, false);
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_pointer<foo0_t>::value, false);
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_void<foo0_t>::value, false);
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_integral<foo0_t>::value, false);
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_float<foo0_t>::value, false);
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_arithmetic<foo0_t>::value, false);
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_fundamental<foo0_t>::value, false);
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_reference<foo0_t>::value, false);
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_member_pointer<foo0_t>::value, false);
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_enum<foo0_t>::value, false);
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_union<foo0_t>::value, false);
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_object<foo0_t>::value, false);
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_scalar<foo0_t>::value, false);
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_class<foo0_t>::value, false);
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_compound<foo0_t>::value, false);
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_POD<foo0_t>::value, false);
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_constructor<foo0_t>::value, false);
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_copy<foo0_t>::value, false);
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_assign<foo0_t>::value, false);
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_destructor<foo0_t>::value, false);
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_empty<foo0_t>::value, false);
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_pointer<foo1_t>::value, false);
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_void<foo1_t>::value, false);
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_integral<foo0_t>::value, false);
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_float<foo0_t>::value, false);
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_arithmetic<foo1_t>::value, false);
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_fundamental<foo1_t>::value, false);
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_reference<foo1_t>::value, false);
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_member_pointer<foo1_t>::value, false);
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_enum<foo1_t>::value, false);
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_union<foo1_t>::value, false);
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_object<foo1_t>::value, false);
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_scalar<foo1_t>::value, false);
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_class<foo1_t>::value, false);
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_compound<foo1_t>::value, false);
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_POD<foo1_t>::value, false);
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_constructor<foo1_t>::value, false);
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_copy<foo1_t>::value, false);
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_assign<foo1_t>::value, false);
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_destructor<foo1_t>::value, false);
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_empty<foo1_t>::value, false);
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_pointer<foo2_t>::value, false);
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_void<foo2_t>::value, false);
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_integral<foo2_t>::value, false);
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_float<foo2_t>::value, false);
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_arithmetic<foo2_t>::value, false);
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_fundamental<foo2_t>::value, false);
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_reference<foo2_t>::value, false);
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_member_pointer<foo2_t>::value, false);
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_enum<foo2_t>::value, false);
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_union<foo2_t>::value, false);
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_object<foo2_t>::value, false);
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_scalar<foo2_t>::value, false);
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_class<foo2_t>::value, false);
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_compound<foo2_t>::value, false);
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_POD<foo2_t>::value, false);
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_constructor<foo2_t>::value, false);
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_copy<foo2_t>::value, false);
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_assign<foo2_t>::value, false);
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_destructor<foo2_t>::value, false);
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_empty<foo2_t>::value, false);
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_pointer<foo3_t>::value, false);
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_void<foo3_t>::value, false);
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_integral<foo3_t>::value, false);
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_float<foo3_t>::value, false);
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_arithmetic<foo3_t>::value, false);
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_fundamental<foo3_t>::value, false);
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_reference<foo3_t>::value, false);
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_member_pointer<foo3_t>::value, false);
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_enum<foo3_t>::value, false);
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_union<foo3_t>::value, false);
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_object<foo3_t>::value, false);
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_scalar<foo3_t>::value, false);
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_class<foo3_t>::value, false);
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_compound<foo3_t>::value, false);
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_POD<foo3_t>::value, false);
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_constructor<foo3_t>::value, false);
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_copy<foo3_t>::value, false);
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_assign<foo3_t>::value, false);
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_destructor<foo3_t>::value, false);
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_empty<foo3_t>::value, false);
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_pointer<foo4_t>::value, false);
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_void<foo4_t>::value, false);
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_integral<foo4_t>::value, false);
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_float<foo4_t>::value, false);
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_arithmetic<foo4_t>::value, false);
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_fundamental<foo4_t>::value, false);
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_reference<foo4_t>::value, false);
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_member_pointer<foo4_t>::value, false);
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_enum<foo4_t>::value, false);
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_union<foo4_t>::value, false);
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_object<foo4_t>::value, false);
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_scalar<foo4_t>::value, false);
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_class<foo4_t>::value, false);
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_compound<foo4_t>::value, false);
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_POD<foo4_t>::value, false);
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_constructor<foo4_t>::value, false);
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_copy<foo4_t>::value, false);
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_assign<foo4_t>::value, false);
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_destructor<foo4_t>::value, false);
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_empty<foo4_t>::value, false);
TT_TEST_END

View File

@@ -0,0 +1,55 @@
#include "test.hpp"
#include "check_integral_constant.hpp"
#include TYPE_TRAITS(is_function)
#include TYPE_TRAITS(is_pointer)
#include TYPE_TRAITS(is_void)
#include TYPE_TRAITS(is_integral)
#include TYPE_TRAITS(is_float)
#include TYPE_TRAITS(is_arithmetic)
#include TYPE_TRAITS(is_fundamental)
#include TYPE_TRAITS(is_member_pointer)
#include TYPE_TRAITS(is_enum)
#include TYPE_TRAITS(is_object)
#include TYPE_TRAITS(is_scalar)
#include TYPE_TRAITS(is_class)
#include TYPE_TRAITS(is_POD)
#include TYPE_TRAITS(has_trivial_constructor)
#include TYPE_TRAITS(has_trivial_copy)
#include TYPE_TRAITS(has_trivial_assign)
#include TYPE_TRAITS(has_trivial_destructor)
#include TYPE_TRAITS(is_empty)
#include TYPE_TRAITS(is_compound)
TT_TEST_BEGIN(incomplete_type_tricky_tests)
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_pointer<incomplete_type>::value, false);
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_function<incomplete_type>::value, false);
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_void<incomplete_type>::value, false);
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_integral<incomplete_type>::value, false);
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_float<incomplete_type>::value, false);
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_arithmetic<incomplete_type>::value, false);
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_fundamental<incomplete_type>::value, false);
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_reference<incomplete_type>::value, false);
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_member_pointer<incomplete_type>::value, false);
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_enum<incomplete_type>::value, false);
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_union<incomplete_type>::value, false);
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_scalar<incomplete_type>::value, false);
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_class<incomplete_type>::value, true);
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_compound<incomplete_type>::value, true);
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_POD<incomplete_type>::value, false);
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_constructor<incomplete_type>::value, false);
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_copy<incomplete_type>::value, false);
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_assign<incomplete_type>::value, false);
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_destructor<incomplete_type>::value, false);
// this one is only partly correct:
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_object<incomplete_type>::value, true);
TT_TEST_END

View File

@@ -0,0 +1,71 @@
#include "test.hpp"
#include "check_integral_constant.hpp"
#include TYPE_TRAITS(is_class)
#include TYPE_TRAITS(alignment_of)
#include TYPE_TRAITS(has_nothrow_assign)
#include TYPE_TRAITS(has_nothrow_constructor)
#include TYPE_TRAITS(has_nothrow_copy)
#include TYPE_TRAITS(has_trivial_assign)
#include TYPE_TRAITS(has_trivial_constructor)
#include TYPE_TRAITS(has_trivial_copy)
#include TYPE_TRAITS(has_trivial_destructor)
#include TYPE_TRAITS(is_base_and_derived)
#include TYPE_TRAITS(is_object)
#include TYPE_TRAITS(is_pod)
#include TYPE_TRAITS(is_scalar)
#include TYPE_COMPARE(is_same)
#include TYPE_COMPARE(is_convertible)
//
// VC++ emits an awful lot of warnings unless we define these:
#ifdef BOOST_MSVC
# pragma warning(disable:4244)
#endif
template <class T>
struct align_calc
{
char padding;
T instance;
static std::ptrdiff_t get()
{
static align_calc<T> a;
return reinterpret_cast<const char*>(&(a.instance)) - reinterpret_cast<const char*>(&(a.padding));
}
};
#define ALIGNOF(x) align_calc<x>::get()
TT_TEST_BEGIN(partial_specialization_tricky_tests)
//
// corner cases which don't compile without partial specialization
// support:
//
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::alignment_of<char&>::value, ALIGNOF(void*));
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::alignment_of<char (&)(int)>::value, ALIGNOF(void*));
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::alignment_of<char(&)[4]>::value, ALIGNOF(void*));
BOOST_CHECK_INTEGRAL_CONSTANT((::tt::is_base_and_derived<Base&,Derived>::value), false);
BOOST_CHECK_INTEGRAL_CONSTANT((::tt::is_base_and_derived<Base&,Derived&>::value), false);
BOOST_CHECK_INTEGRAL_CONSTANT((::tt::is_base_and_derived<Base,Derived&>::value), false);
BOOST_CHECK_INTEGRAL_CONSTANT((::tt::is_base_and_derived<Base,void>::value), false);
BOOST_CHECK_INTEGRAL_CONSTANT((::tt::is_same<void, int>::value), false);
BOOST_CHECK_INTEGRAL_CONSTANT((::tt::is_same<void, void>::value), true);
BOOST_CHECK_INTEGRAL_CONSTANT((::tt::is_same<void, const void>::value), false);
BOOST_CHECK_INTEGRAL_CONSTANT((::tt::is_same<test_abc1, test_abc1>::value), true);
BOOST_CHECK_INTEGRAL_CONSTANT((::tt::is_same<test_abc1, const test_abc1>::value), false);
BOOST_CHECK_INTEGRAL_CONSTANT((::tt::is_convertible<void,float>::value), false);
TT_TEST_END

View File

@@ -0,0 +1,204 @@
#include "test.hpp"
#include "check_integral_constant.hpp"
#include TYPE_TRAITS(alignment_of)
#include TYPE_TRAITS(type_with_alignment)
#include TYPE_TRAITS(is_pod)
TT_TEST_BEGIN(type_with_alignment)
BOOST_MESSAGE(typeid(::tt::type_with_alignment<
::tt::alignment_of<char>::value
>::type).name());
BOOST_CHECK(::tt::alignment_of<
::tt::type_with_alignment<
::tt::alignment_of<char>::value
>::type
>::value == ::boost::alignment_of<char>::value);
BOOST_CHECK(::tt::alignment_of<
::tt::type_with_alignment<
::tt::alignment_of<short>::value
>::type
>::value == ::boost::alignment_of<short>::value);
BOOST_CHECK(::tt::alignment_of<
::tt::type_with_alignment<
::tt::alignment_of<int>::value
>::type
>::value == ::boost::alignment_of<int>::value);
BOOST_CHECK(::tt::alignment_of<
::tt::type_with_alignment<
::tt::alignment_of<long>::value
>::type
>::value == ::boost::alignment_of<long>::value);
BOOST_CHECK(::tt::alignment_of<
::tt::type_with_alignment<
::tt::alignment_of<float>::value
>::type
>::value == ::boost::alignment_of<float>::value);
BOOST_CHECK(::tt::alignment_of<
::tt::type_with_alignment<
::tt::alignment_of<double>::value
>::type
>::value == ::boost::alignment_of<double>::value);
BOOST_CHECK(::tt::alignment_of<
::tt::type_with_alignment<
::tt::alignment_of<long double>::value
>::type
>::value == ::boost::alignment_of<long double>::value);
#ifdef BOOST_HAS_LONG_LONG
BOOST_CHECK(::tt::alignment_of<
::tt::type_with_alignment<
::tt::alignment_of<long long>::value
>::type
>::value == ::boost::alignment_of<long long>::value);
#endif
#ifdef BOOST_HAS_MS_INT64
BOOST_CHECK(::tt::alignment_of<
::tt::type_with_alignment<
::tt::alignment_of<__int64>::value
>::type
>::value == ::boost::alignment_of<__int64>::value);
#endif
BOOST_CHECK(::tt::alignment_of<
::tt::type_with_alignment<
::tt::alignment_of<int[4]>::value
>::type
>::value == ::boost::alignment_of<int[4]>::value);
BOOST_CHECK(::tt::alignment_of<
::tt::type_with_alignment<
::tt::alignment_of<int(*)(int)>::value
>::type
>::value == ::boost::alignment_of<int(*)(int)>::value);
BOOST_CHECK(::tt::alignment_of<
::tt::type_with_alignment<
::tt::alignment_of<int*>::value
>::type
>::value == ::boost::alignment_of<int*>::value);
BOOST_CHECK(::tt::alignment_of<
::tt::type_with_alignment<
::tt::alignment_of<VB>::value
>::type
>::value == ::boost::alignment_of<VB>::value);
BOOST_CHECK(::tt::alignment_of<
::tt::type_with_alignment<
::tt::alignment_of<VD>::value
>::type
>::value == ::boost::alignment_of<VD>::value);
BOOST_CHECK(::tt::alignment_of<
::tt::type_with_alignment<
::tt::alignment_of<enum_UDT>::value
>::type
>::value == ::boost::alignment_of<enum_UDT>::value);
BOOST_CHECK(::tt::alignment_of<
::tt::type_with_alignment<
::tt::alignment_of<mf2>::value
>::type
>::value == ::boost::alignment_of<mf2>::value);
BOOST_CHECK(::tt::alignment_of<
::tt::type_with_alignment<
::tt::alignment_of<POD_UDT>::value
>::type
>::value == ::boost::alignment_of<POD_UDT>::value);
BOOST_CHECK(::tt::alignment_of<
::tt::type_with_alignment<
::tt::alignment_of<empty_UDT>::value
>::type
>::value == ::boost::alignment_of<empty_UDT>::value);
BOOST_CHECK(::tt::alignment_of<
::tt::type_with_alignment<
::tt::alignment_of<union_UDT>::value
>::type
>::value == ::boost::alignment_of<union_UDT>::value);
// check that the type produced are POD's:
BOOST_CHECK(::tt::is_POD<
::tt::type_with_alignment<
::tt::alignment_of<char>::value>::type
>::value);
BOOST_CHECK(::tt::is_POD<
::tt::type_with_alignment<
::tt::alignment_of<short>::value>::type
>::value);
BOOST_CHECK(::tt::is_POD<
::tt::type_with_alignment<
::tt::alignment_of<int>::value>::type
>::value);
BOOST_CHECK(::tt::is_POD<
::tt::type_with_alignment<
::tt::alignment_of<long>::value>::type
>::value);
BOOST_CHECK(::tt::is_POD<
::tt::type_with_alignment<
::tt::alignment_of<float>::value>::type
>::value);
BOOST_CHECK(::tt::is_POD<
::tt::type_with_alignment<
::tt::alignment_of<double>::value>::type
>::value);
BOOST_CHECK(::tt::is_POD<
::tt::type_with_alignment<
::tt::alignment_of<long double>::value>::type
>::value);
#ifdef BOOST_HAS_LONG_LONG
BOOST_CHECK(::tt::is_POD<
::tt::type_with_alignment<
::tt::alignment_of<long long>::value>::type
>::value);
#endif
#ifdef BOOST_HAS_MS_INT64
BOOST_CHECK(::tt::is_POD<
::tt::type_with_alignment<
::tt::alignment_of<__int64>::value>::type
>::value);
#endif
BOOST_CHECK(::tt::is_POD<
::tt::type_with_alignment<
::tt::alignment_of<int[4]>::value>::type
>::value);
BOOST_CHECK(::tt::is_POD<
::tt::type_with_alignment<
::tt::alignment_of<int(*)(int)>::value>::type
>::value);
BOOST_CHECK(::tt::is_POD<
::tt::type_with_alignment<
::tt::alignment_of<int*>::value>::type
>::value);
BOOST_CHECK(::tt::is_POD<
::tt::type_with_alignment<
::tt::alignment_of<VB>::value>::type
>::value);
BOOST_CHECK(::tt::is_POD<
::tt::type_with_alignment<
::tt::alignment_of<VD>::value>::type
>::value);
BOOST_CHECK(::tt::is_POD<
::tt::type_with_alignment<
::tt::alignment_of<enum_UDT>::value>::type
>::value);
BOOST_CHECK(::tt::is_POD<
::tt::type_with_alignment<
::tt::alignment_of<mf2>::value>::type
>::value);
BOOST_CHECK(::tt::is_POD<
::tt::type_with_alignment<
::tt::alignment_of<POD_UDT>::value>::type
>::value);
BOOST_CHECK(::tt::is_POD<
::tt::type_with_alignment<
::tt::alignment_of<empty_UDT>::value>::type
>::value);
BOOST_CHECK(::tt::is_POD<
::tt::type_with_alignment<
::tt::alignment_of<union_UDT>::value>::type
>::value);
TT_TEST_END

View File

@@ -1,36 +0,0 @@
subproject libs/type_traits/tests ;
unit-test alignment_test : alignment_test.cpp <lib>../../test/build/prg_exec_monitor
: <sysinclude>$(BOOST_ROOT) : ;
unit-test arithmetic_traits_test : arithmetic_traits_test.cpp <lib>../../test/build/prg_exec_monitor
: <sysinclude>$(BOOST_ROOT) : ;
unit-test composite_traits_test : composite_traits_test.cpp <lib>../../test/build/prg_exec_monitor
: <sysinclude>$(BOOST_ROOT) : ;
unit-test cv_traits_test : cv_traits_test.cpp <lib>../../test/build/prg_exec_monitor
: <sysinclude>$(BOOST_ROOT) : ;
unit-test is_convertible_test : is_convertible_test.cpp <lib>../../test/build/prg_exec_monitor
: <sysinclude>$(BOOST_ROOT) : ;
unit-test is_function_test : is_function_test.cpp <lib>../../test/build/prg_exec_monitor
: <sysinclude>$(BOOST_ROOT) : ;
unit-test is_same_test : is_same_test.cpp <lib>../../test/build/prg_exec_monitor
: <sysinclude>$(BOOST_ROOT) : ;
unit-test object_type_traits_test : object_type_traits_test.cpp <lib>../../test/build/prg_exec_monitor
: <sysinclude>$(BOOST_ROOT) : ;
unit-test transform_traits_test : transform_traits_test.cpp <lib>../../test/build/prg_exec_monitor
: <sysinclude>$(BOOST_ROOT) : ;

View File

@@ -1,51 +0,0 @@
// (C) Copyright John Maddock 2000. Permission to copy, use, modify, sell and
// distribute this software is granted provided this copyright notice appears
// in all copies. This software is provided "as is" without express or implied
// warranty, and with no claim as to its suitability for any purpose.
#include <boost/type_traits/alignment_traits.hpp>
#include <boost/utility.hpp>
#include <boost/test/execution_monitor.hpp>
#ifdef __BORLANDC__
#pragma hrdstop
#endif
#include "boost/type_traits/type_traits_test.hpp"
NESTED_DECL(alignment_of)
int cpp_main(int argc, char* argv[])
{
NESTED_TEST(alignment_of, int)
NESTED_TEST(alignment_of, int_constructible)
align_test(int);
align_test(char);
align_test(double);
align_test(int[4]);
align_test(int(*)(int));
#ifndef BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION
align_test(char&);
align_test(char (&)(int));
align_test(char(&)[4]);
#endif
align_test(int*);
//align_test(const int);
align_test(VB);
align_test(VD);
value_test(0, ::boost::alignment_of<void>::value);
type_with_align_test(int);
type_with_align_test(int(*)(int));
type_with_align_test(VB);
type_with_align_test(VD);
type_with_align_test(char[13]);
return check_result(argc, argv);
}
//
// define the number of failures expected for given compilers:
unsigned int expected_failures = 0;

View File

@@ -1,203 +0,0 @@
// (C) Copyright John Maddock 2000. Permission to copy, use, modify, sell and
// distribute this software is granted provided this copyright notice appears
// in all copies. This software is provided "as is" without express or implied
// warranty, and with no claim as to its suitability for any purpose.
#include <boost/type_traits/arithmetic_traits.hpp>
#include <boost/test/execution_monitor.hpp>
#include <boost/utility.hpp>
#ifdef __BORLANDC__
#pragma hrdstop
#endif
#include "boost/type_traits/type_traits_test.hpp"
NESTED_DECL(is_void)
NESTED_DECL(is_integral)
NESTED_DECL(is_float)
NESTED_DECL(is_arithmetic)
NESTED_DECL(is_fundamental)
int cpp_main(int argc, char* argv[])
{
NESTED_TEST(is_void, void)
NESTED_TEST(is_void, int)
NESTED_TEST(is_integral, int)
NESTED_TEST(is_integral, float)
NESTED_TEST(is_float, void)
NESTED_TEST(is_float, double)
NESTED_TEST(is_arithmetic, void)
NESTED_TEST(is_arithmetic, int)
NESTED_TEST(is_fundamental, UDT)
NESTED_TEST(is_fundamental, int)
value_test(true, boost::is_void<void>::value)
value_test(true, boost::is_void<const void>::value)
value_test(true, boost::is_void<volatile void>::value)
value_test(true, boost::is_void<const volatile void>::value)
value_test(false, boost::is_void<int>::value)
value_test(false, boost::is_void<test_abc1>::value)
value_test(false, boost::is_integral<UDT>::value)
value_test(false, boost::is_integral<void>::value)
value_test(true, boost::is_integral<bool>::value)
value_test(true, boost::is_integral<char>::value)
value_test(true, boost::is_integral<signed char>::value)
value_test(true, boost::is_integral<unsigned char>::value)
value_test(true, boost::is_integral<wchar_t>::value)
value_test(true, boost::is_integral<short>::value)
value_test(true, boost::is_integral<unsigned short>::value)
value_test(true, boost::is_integral<int>::value)
value_test(true, boost::is_integral<unsigned int>::value)
value_test(true, boost::is_integral<long>::value)
value_test(true, boost::is_integral<unsigned long>::value)
value_test(false, boost::is_integral<float>::value)
value_test(false, boost::is_integral<double>::value)
value_test(false, boost::is_integral<long double>::value)
#ifdef BOOST_HAS_LONG_LONG
value_test(true, boost::is_integral<long long>::value)
value_test(true, boost::is_integral<unsigned long long>::value)
#endif
#if defined(BOOST_HAS_MS_INT64)
value_test(true, boost::is_integral<__int64>::value)
value_test(true, boost::is_integral<unsigned __int64>::value)
#endif
//const qualified ints:
value_test(true, boost::is_integral<const bool>::value)
value_test(true, boost::is_integral<const char>::value)
value_test(true, boost::is_integral<const signed char>::value)
value_test(true, boost::is_integral<const unsigned char>::value)
value_test(true, boost::is_integral<const wchar_t>::value)
value_test(true, boost::is_integral<const short>::value)
value_test(true, boost::is_integral<const unsigned short>::value)
value_test(true, boost::is_integral<const int>::value)
value_test(true, boost::is_integral<const unsigned int>::value)
value_test(true, boost::is_integral<const long>::value)
value_test(true, boost::is_integral<const unsigned long>::value)
#ifdef BOOST_HAS_LONG_LONG
value_test(true, boost::is_integral<const long long>::value)
value_test(true, boost::is_integral<const unsigned long long>::value)
#endif
#if defined(BOOST_HAS_MS_INT64)
value_test(true, boost::is_integral<const __int64>::value)
value_test(true, boost::is_integral<const unsigned __int64>::value)
#endif
// volatile qualified ints:
value_test(true, boost::is_integral<volatile bool>::value)
value_test(true, boost::is_integral<volatile char>::value)
value_test(true, boost::is_integral<volatile signed char>::value)
value_test(true, boost::is_integral<volatile unsigned char>::value)
value_test(true, boost::is_integral<volatile wchar_t>::value)
value_test(true, boost::is_integral<volatile short>::value)
value_test(true, boost::is_integral<volatile unsigned short>::value)
value_test(true, boost::is_integral<volatile int>::value)
value_test(true, boost::is_integral<volatile unsigned int>::value)
value_test(true, boost::is_integral<volatile long>::value)
value_test(true, boost::is_integral<volatile unsigned long>::value)
#ifdef BOOST_HAS_LONG_LONG
value_test(true, boost::is_integral<volatile long long>::value)
value_test(true, boost::is_integral<volatile unsigned long long>::value)
#endif
#if defined(BOOST_HAS_MS_INT64)
value_test(true, boost::is_integral<volatile __int64>::value)
value_test(true, boost::is_integral<volatile unsigned __int64>::value)
#endif
//const qualified ints:
value_test(true, boost::is_integral<const volatile bool>::value)
value_test(true, boost::is_integral<const volatile char>::value)
value_test(true, boost::is_integral<const volatile signed char>::value)
value_test(true, boost::is_integral<const volatile unsigned char>::value)
value_test(true, boost::is_integral<const volatile wchar_t>::value)
value_test(true, boost::is_integral<const volatile short>::value)
value_test(true, boost::is_integral<const volatile unsigned short>::value)
value_test(true, boost::is_integral<const volatile int>::value)
value_test(true, boost::is_integral<const volatile unsigned int>::value)
value_test(true, boost::is_integral<const volatile long>::value)
value_test(true, boost::is_integral<const volatile unsigned long>::value)
#ifdef BOOST_HAS_LONG_LONG
value_test(true, boost::is_integral<const volatile long long>::value)
value_test(true, boost::is_integral<const volatile unsigned long long>::value)
#endif
#if defined(BOOST_HAS_MS_INT64)
value_test(true, boost::is_integral<const volatile __int64>::value)
value_test(true, boost::is_integral<const volatile unsigned __int64>::value)
#endif
value_test(false, boost::is_integral<test_abc1>::value)
value_test(true, boost::is_float<const volatile float>::value)
value_test(true, boost::is_float<const volatile double>::value)
value_test(true, boost::is_float<const volatile long double>::value)
value_test(true, boost::is_float<volatile float>::value)
value_test(true, boost::is_float<volatile double>::value)
value_test(true, boost::is_float<volatile long double>::value)
value_test(true, boost::is_float<const float>::value)
value_test(true, boost::is_float<const double>::value)
value_test(true, boost::is_float<const long double>::value)
value_test(true, boost::is_float<float>::value)
value_test(true, boost::is_float<double>::value)
value_test(true, boost::is_float<long double>::value)
value_test(false, boost::is_float<int>::value)
value_test(false, boost::is_float<void>::value)
value_test(false, boost::is_float<UDT>::value)
value_test(false, boost::is_float<test_abc1>::value)
value_test(false, boost::is_arithmetic<UDT>::value)
value_test(false, boost::is_arithmetic<void>::value)
value_test(true, boost::is_arithmetic<bool>::value)
value_test(true, boost::is_arithmetic<char>::value)
value_test(true, boost::is_arithmetic<signed char>::value)
value_test(true, boost::is_arithmetic<unsigned char>::value)
value_test(true, boost::is_arithmetic<wchar_t>::value)
value_test(true, boost::is_arithmetic<short>::value)
value_test(true, boost::is_arithmetic<unsigned short>::value)
value_test(true, boost::is_arithmetic<int>::value)
value_test(true, boost::is_arithmetic<unsigned int>::value)
value_test(true, boost::is_arithmetic<long>::value)
value_test(true, boost::is_arithmetic<unsigned long>::value)
value_test(true, boost::is_arithmetic<float>::value)
value_test(true, boost::is_arithmetic<double>::value)
value_test(true, boost::is_arithmetic<long double>::value)
#ifdef BOOST_HAS_LONG_LONG
value_test(true, boost::is_arithmetic<long long>::value)
value_test(true, boost::is_arithmetic<unsigned long long>::value)
#endif
#if defined(BOOST_HAS_MS_INT64)
value_test(true, boost::is_arithmetic<__int64>::value)
value_test(true, boost::is_arithmetic<unsigned __int64>::value)
#endif
value_test(false, boost::is_arithmetic<test_abc1>::value)
value_test(false, boost::is_fundamental<UDT>::value)
value_test(false, boost::is_fundamental<test_abc1>::value)
value_test(true, boost::is_fundamental<void>::value)
value_test(true, boost::is_fundamental<bool>::value)
value_test(true, boost::is_fundamental<char>::value)
value_test(true, boost::is_fundamental<signed char>::value)
value_test(true, boost::is_fundamental<unsigned char>::value)
value_test(true, boost::is_fundamental<wchar_t>::value)
value_test(true, boost::is_fundamental<short>::value)
value_test(true, boost::is_fundamental<unsigned short>::value)
value_test(true, boost::is_fundamental<int>::value)
value_test(true, boost::is_fundamental<unsigned int>::value)
value_test(true, boost::is_fundamental<long>::value)
value_test(true, boost::is_fundamental<unsigned long>::value)
value_test(true, boost::is_fundamental<float>::value)
value_test(true, boost::is_fundamental<double>::value)
value_test(true, boost::is_fundamental<long double>::value)
#ifdef BOOST_HAS_LONG_LONG
value_test(true, boost::is_fundamental<long long>::value)
value_test(true, boost::is_fundamental<unsigned long long>::value)
#endif
#if defined(BOOST_HAS_MS_INT64)
value_test(true, boost::is_fundamental<__int64>::value)
value_test(true, boost::is_fundamental<unsigned __int64>::value)
#endif
return check_result(argc, argv);
}
//
// define the number of failures expected for given compilers:
unsigned int expected_failures = 0;

View File

@@ -1,158 +0,0 @@
// (C) Copyright John Maddock 2000. Permission to copy, use, modify, sell and
// distribute this software is granted provided this copyright notice appears
// in all copies. This software is provided "as is" without express or implied
// warranty, and with no claim as to its suitability for any purpose.
#include <boost/type_traits/composite_traits.hpp>
#include <boost/utility.hpp>
#include <boost/test/execution_monitor.hpp>
#ifdef __BORLANDC__
#pragma hrdstop
#endif
#include "boost/type_traits/type_traits_test.hpp"
NESTED_DECL(is_array)
NESTED_DECL(is_pointer)
NESTED_DECL(is_reference)
struct convertible_to_pointer
{
operator char*() const;
};
int cpp_main(int argc, char* argv[])
{
NESTED_TEST(is_array, int)
NESTED_TEST(is_array, int[2])
NESTED_TEST(is_array, int[3][4])
NESTED_TEST(is_array, int const [5])
NESTED_TEST(is_array, int(&)[2])
NESTED_TEST(is_array, int (*)(double))
NESTED_TEST(is_pointer, int)
NESTED_TEST(is_pointer, int*)
NESTED_TEST(is_reference, int)
NESTED_TEST(is_reference, int&)
value_test(false, boost::is_array<int>::value)
value_test(false, boost::is_array<int*>::value)
value_test(false, boost::is_array<const int*>::value)
value_test(false, boost::is_array<const volatile int*>::value)
value_test(false, boost::is_array<int*const>::value)
value_test(false, boost::is_array<const int*volatile>::value)
value_test(false, boost::is_array<const volatile int*const>::value)
value_test(true, boost::is_array<int[2]>::value)
value_test(true, boost::is_array<const int[2]>::value)
value_test(true, boost::is_array<const volatile int[2]>::value)
value_test(true, boost::is_array<int[2][3]>::value)
value_test(true, boost::is_array<UDT[2]>::value)
value_test(false, boost::is_array<int(&)[2]>::value)
value_test(false, boost::is_array<f1>::value)
value_test(false, boost::is_array<void>::value)
value_test(false, boost::is_array<test_abc1>::value)
value_test(false, boost::is_array<convertible_to_pointer>::value)
value_test(false, boost::is_pointer<int>::value)
value_test(false, boost::is_pointer<int&>::value)
value_test(true, boost::is_pointer<int*>::value)
value_test(true, boost::is_pointer<const int*>::value)
value_test(true, boost::is_pointer<volatile int*>::value)
value_test(true, boost::is_pointer<non_pointer*>::value)
// these were false in previous versions (JM 20 Dec 2000):
value_test(true, boost::is_pointer<int*const>::value)
value_test(true, boost::is_pointer<int*volatile>::value)
value_test(true, boost::is_pointer<int*const volatile>::value)
// JM 02 Oct 2000:
value_test(false, boost::is_pointer<non_pointer>::value)
value_test(false, boost::is_pointer<int*&>::value)
value_test(false, boost::is_pointer<int(&)[2]>::value)
value_test(false, boost::is_pointer<int[2]>::value)
value_test(false, boost::is_pointer<char[sizeof(void*)]>::value)
value_test(false, boost::is_pointer<void>::value)
value_test(true, boost::is_pointer<f1>::value)
value_test(true, boost::is_pointer<f2>::value)
value_test(true, boost::is_pointer<f3>::value)
// Steve: was 'true', should be 'false', via 3.9.2p3
value_test(false, boost::is_pointer<mf1>::value)
value_test(false, boost::is_pointer<mf2>::value)
value_test(false, boost::is_pointer<mf3>::value)
value_test(false, boost::is_pointer<mf4>::value)
value_test(false, boost::is_pointer<test_abc1>::value)
value_test(false, boost::is_reference<bool>::value)
value_test(true, boost::is_reference<int&>::value)
value_test(true, boost::is_reference<const int&>::value)
value_test(true, boost::is_reference<volatile int &>::value)
value_test(true, boost::is_reference<const volatile int &>::value)
value_test(true, boost::is_reference<r_type>::value)
value_test(true, boost::is_reference<cr_type>::value)
value_test(true, boost::is_reference<const UDT&>::value)
value_test(false, boost::is_reference<void>::value)
value_test(false, boost::is_reference<test_abc1>::value)
value_test(false, boost::is_member_pointer<f1>::value)
value_test(false, boost::is_member_pointer<f2>::value)
value_test(false, boost::is_member_pointer<f3>::value)
value_test(false, boost::is_member_pointer<void*>::value)
value_test(true, boost::is_member_pointer<mf1>::value)
value_test(true, boost::is_member_pointer<mf2>::value)
value_test(true, boost::is_member_pointer<mf3>::value)
value_test(true, boost::is_member_pointer<mf4>::value)
value_test(true, boost::is_member_pointer<cmf>::value)
value_test(true, boost::is_member_pointer<mp>::value)
value_test(false, boost::is_member_pointer<void>::value)
value_test(false, boost::is_member_pointer<test_abc1>::value)
value_test(false, boost::is_member_function_pointer<f1>::value)
value_test(false, boost::is_member_function_pointer<f2>::value)
value_test(false, boost::is_member_function_pointer<f3>::value)
value_test(false, boost::is_member_function_pointer<void*>::value)
value_test(true, boost::is_member_function_pointer<mf1>::value)
value_test(true, boost::is_member_function_pointer<mf2>::value)
value_test(true, boost::is_member_function_pointer<mf3>::value)
value_test(true, boost::is_member_function_pointer<mf4>::value)
value_test(true, boost::is_member_function_pointer<cmf>::value)
value_test(false, boost::is_member_function_pointer<mp>::value)
value_test(false, boost::is_member_function_pointer<void>::value)
value_test(false, boost::is_member_function_pointer<test_abc1>::value)
value_test(false, boost::is_enum<int>::value)
value_test(true, boost::is_enum<enum_UDT>::value)
value_test(false, boost::is_enum<int_convertible>::value)
value_test(false, boost::is_enum<int&>::value)
value_test(false, boost::is_enum<boost::noncopyable>::value)
value_test(false, boost::is_enum<void>::value)
value_test(false, boost::is_enum<test_abc1>::value)
return check_result(argc, argv);
}
//
// define the number of failures expected for given compilers:
#if defined(__BORLANDC__) && (__BORLANDC__ <= 0x551)
unsigned int expected_failures = 2;
#elif defined(__BORLANDC__)
unsigned int expected_failures = 1;
#elif defined(__SUNPRO_CC)
#if (__SUNPRO_CC <= 0x520)
unsigned int expected_failures = 11;
#else
unsigned int expected_failures = 1;
#endif
#elif defined(__GNUC__)
#if (__GNUC__ > 3) || ( __GNUC__ == 3 && __GNUC_MINOR__ >= 1)
unsigned int expected_failures = 0;
# else
unsigned int expected_failures = 1; // can't handle cv-qualified references
# endif
#elif defined(BOOST_MSVC)
unsigned int expected_failures = 0;
#elif defined(__MWERKS__) && __MWERKS__ < 0x3000 || defined(__HP_aCC)
unsigned int expected_failures = 1; // is_enum doesn't work
#else
unsigned int expected_failures = 0;
#endif

View File

@@ -1,65 +0,0 @@
// (C) Copyright John Maddock 2000. Permission to copy, use, modify, sell and
// distribute this software is granted provided this copyright notice appears
// in all copies. This software is provided "as is" without express or implied
// warranty, and with no claim as to its suitability for any purpose.
#include <boost/type_traits/cv_traits.hpp>
#include <boost/utility.hpp>
#include <boost/test/execution_monitor.hpp>
#ifdef __BORLANDC__
#pragma hrdstop
#endif
#include "boost/type_traits/type_traits_test.hpp"
NESTED_DECL(is_const)
NESTED_DECL(is_volatile)
int cpp_main(int argc, char* argv[])
{
NESTED_TEST(is_const, int)
NESTED_TEST(is_const, const int)
NESTED_TEST(is_const, volatile int)
NESTED_TEST(is_volatile, int)
NESTED_TEST(is_volatile, const int)
NESTED_TEST(is_volatile, volatile int)
value_test(false, boost::is_const<void>::value)
value_test(true, boost::is_const<const void>::value)
value_test(false, boost::is_const<test_abc1>::value)
value_test(true, boost::is_const<const test_abc1>::value)
value_test(false, boost::is_const<int>::value)
value_test(true, boost::is_const<const int>::value)
value_test(true, boost::is_const<const UDT>::value)
value_test(true, boost::is_const<const volatile UDT>::value)
value_test(false, boost::is_const<const int&>::value)
#if !defined(__GNUC__) || ( __GNUC__ > 3 ) || ( __GNUC__ ==3 && __GNUC_MINOR__ >=1)
value_test(false, boost::is_const<cr_type>::value)
#else
value_fail(false, boost::is_const<cr_type>::value)
#endif
value_test(false, boost::is_volatile<void>::value)
value_test(true, boost::is_volatile<volatile void>::value)
value_test(false, boost::is_volatile<test_abc1>::value)
value_test(true, boost::is_volatile<volatile test_abc1>::value)
value_test(false, boost::is_volatile<int>::value)
value_test(true, boost::is_volatile<volatile int>::value)
value_test(true, boost::is_volatile<volatile UDT>::value)
value_test(true, boost::is_volatile<volatile UDT>::value)
return check_result(argc, argv);
}
//
// define the number of failures expected for given compilers:
#if defined(BOOST_MSVC) && _MSC_VER <= 1300
unsigned int expected_failures = 2;
#elif defined(__SUNPRO_CC) && (__SUNPRO_CC < 0x530)
unsigned int expected_failures = 1;
#else
unsigned int expected_failures = 0;
#endif

View File

@@ -1,60 +0,0 @@
// (C) Copyright Doug Gregor 2002. Permission to copy, use, modify, sell and
// distribute this software is granted provided this copyright notice appears
// in all copies. This software is provided "as is" without express or implied
// warranty, and with no claim as to its suitability for any purpose.
#include <boost/type_traits/function_traits.hpp>
#define BOOST_INCLUDE_MAIN
#include <boost/test/test_tools.hpp>
template<typename T>
struct is_int
{
BOOST_STATIC_CONSTANT(bool, value = false);
};
template<>
struct is_int<int>
{
BOOST_STATIC_CONSTANT(bool, value = true);
};
template<typename T>
struct is_float
{
BOOST_STATIC_CONSTANT(bool, value = false);
};
template<>
struct is_float<float>
{
BOOST_STATIC_CONSTANT(bool, value = true);
};
template<typename T>
struct is_double
{
BOOST_STATIC_CONSTANT(bool, value = false);
};
template<>
struct is_double<double>
{
BOOST_STATIC_CONSTANT(bool, value = true);
};
int test_main(int, char*[])
{
typedef int F2(float, double);
typedef boost::function_traits<F2> traits;
BOOST_TEST(traits::arity == 2);
#ifndef BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION
BOOST_TEST(is_int<traits::result_type>::value);
BOOST_TEST(is_float<traits::arg1_type>::value);
BOOST_TEST(is_double<traits::arg2_type>::value);
#endif // BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION
return 0;
}

View File

@@ -1,112 +0,0 @@
// (C) Copyright John Maddock 2000. Permission to copy, use, modify, sell and
// distribute this software is granted provided this copyright notice appears
// in all copies. This software is provided "as is" without express or implied
// warranty, and with no claim as to its suitability for any purpose.
#include <boost/type_traits/conversion_traits.hpp>
#include <boost/utility.hpp>
#include <boost/test/execution_monitor.hpp>
#include "boost/type_traits/type_traits_test.hpp"
template <class T>
struct convertible_from
{
convertible_from(T);
};
#if defined(__BORLANDC__) && (__BORLANDC__ <= 0x551)
# define maybe_value_test value_fail
#else
# define maybe_value_test value_test
#endif
int cpp_main(int argc, char* argv[])
{
value_test(true, (boost::is_convertible<Derived,Base>::value));
value_test(true, (boost::is_convertible<Derived,Derived>::value));
value_test(true, (boost::is_convertible<Base,Base>::value));
value_test(false, (boost::is_convertible<Base,Derived>::value));
value_test(true, (boost::is_convertible<Derived,Derived>::value));
value_test(false, (boost::is_convertible<NonDerived,Base>::value));
value_test(true, (boost::is_convertible<float,int>::value));
#ifdef BOOST_MSVC6_MEMBER_TEMPLATES
value_test(false, (boost::is_convertible<float,void>::value));
value_test(false, (boost::is_convertible<void,float>::value));
value_test(true, (boost::is_convertible<void,void>::value));
#endif
value_test(true, (boost::is_convertible<enum1, int>::value));
value_test(true, (boost::is_convertible<Derived*, Base*>::value));
value_test(false, (boost::is_convertible<Base*, Derived*>::value));
value_test(true, (boost::is_convertible<Derived&, Base&>::value));
value_test(false, (boost::is_convertible<Base&, Derived&>::value));
value_test(true, (boost::is_convertible<const Derived*, const Base*>::value));
value_test(false, (boost::is_convertible<const Base*, const Derived*>::value));
value_test(true, (boost::is_convertible<const Derived&, const Base&>::value));
value_test(false, (boost::is_convertible<const Base&, const Derived&>::value));
value_test(false, (boost::is_convertible<const int *, int*>::value));
value_test(false, (boost::is_convertible<const int&, int&>::value));
value_test(true, (boost::is_convertible<int*, int[2]>::value));
value_test(false, (boost::is_convertible<const int*, int[3]>::value));
value_test(true, (boost::is_convertible<const int&, int>::value));
value_test(true, (boost::is_convertible<int(&)[4], const int*>::value));
value_test(true, (boost::is_convertible<int(&)(int), int(*)(int)>::value));
value_test(true, (boost::is_convertible<int *, const int*>::value));
value_test(true, (boost::is_convertible<int&, const int&>::value));
value_test(true, (boost::is_convertible<int[2], int*>::value));
value_test(true, (boost::is_convertible<int[2], const int*>::value));
value_test(false, (boost::is_convertible<const int[2], int*>::value));
value_test(true, (boost::is_convertible<non_pointer, void*>::value));
value_test(false, (boost::is_convertible<non_pointer, int*>::value));
value_test(true, (boost::is_convertible<non_int_pointer, int*>::value));
value_test(true, (boost::is_convertible<non_int_pointer, void*>::value));
value_test(false, (boost::is_convertible<test_abc1&, test_abc2&>::value));
value_test(false, (boost::is_convertible<test_abc1&, int_constructible>::value));
value_test(false, (boost::is_convertible<int_constructible, test_abc1&>::value));
//
// the following tests all involve user defined conversions which do
// not compile with Borland C++ Builder:
//
maybe_value_test(true, (boost::is_convertible<int, int_constructible>::value));
maybe_value_test(true, (boost::is_convertible<float,convertible_from<float> >::value));
maybe_value_test(true, (boost::is_convertible<float,convertible_from<float const&> >::value));
maybe_value_test(true, (boost::is_convertible<float,convertible_from<float&> >::value));
maybe_value_test(true, (boost::is_convertible<float,convertible_from<char> >::value));
maybe_value_test(true, (boost::is_convertible<float,convertible_from<char const&> >::value));
maybe_value_test(false, (boost::is_convertible<float,convertible_from<char&> >::value));
maybe_value_test(true, (boost::is_convertible<char,convertible_from<char> >::value));
maybe_value_test(true, (boost::is_convertible<char,convertible_from<char const&> >::value));
maybe_value_test(true, (boost::is_convertible<char,convertible_from<char&> >::value));
maybe_value_test(true, (boost::is_convertible<float&,convertible_from<float> >::value));
maybe_value_test(true, (boost::is_convertible<float const&,convertible_from<float> >::value));
maybe_value_test(true, (boost::is_convertible<float&,convertible_from<float&> >::value));
maybe_value_test(true, (boost::is_convertible<float const&,convertible_from<float const&> >::value));
maybe_value_test(true, (boost::is_convertible<float&,convertible_from<float const&> >::value));
return check_result(argc, argv);
}
//
// define the number of failures expected for given compilers:
#if defined(__BORLANDC__) && (__BORLANDC__ <= 0x551)
unsigned int expected_failures = 1;
#elif defined(__BORLANDC__)
unsigned int expected_failures = 3;
#elif defined(__MWERKS__) && __MWERKS__ < 0x3000
unsigned int expected_failures = 35;
#else
unsigned int expected_failures = 0;
#endif

View File

@@ -1,82 +0,0 @@
// (C) Copyright John Maddock 2000. Permission to copy, use, modify, sell and
// distribute this software is granted provided this copyright notice appears
// in all copies. This software is provided "as is" without express or implied
// warranty, and with no claim as to its suitability for any purpose.
#include <boost/type_traits.hpp>
#include <boost/test/execution_monitor.hpp>
#include "boost/type_traits/type_traits_test.hpp"
template <class T>
struct is_function_tester
{
static void check();
};
template <class T>
void is_function_tester<T>::check()
{
// if we're a function then we must not be a
// function pointer:
value_test(true, ::boost::is_function<T>::value);
#ifndef BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION
value_test(false, ::boost::is_pointer<T>::value);
value_test(false, ::boost::is_void<T>::value);
value_test(false, ::boost::is_integral<T>::value);
value_test(false, ::boost::is_float<T>::value);
value_test(false, ::boost::is_arithmetic<T>::value);
value_test(false, ::boost::is_fundamental<T>::value);
value_test(false, ::boost::is_reference<T>::value);
value_test(false, ::boost::is_member_pointer<T>::value);
value_test(false, ::boost::is_enum<T>::value);
value_test(false, ::boost::is_union<T>::value);
value_test(false, ::boost::is_object<T>::value);
value_test(false, ::boost::is_scalar<T>::value);
value_test(false, ::boost::is_class<T>::value);
value_test(false, ::boost::is_compound<T>::value);
value_test(false, ::boost::is_POD<T>::value);
value_test(false, ::boost::has_trivial_constructor<T>::value);
value_test(false, ::boost::has_trivial_copy<T>::value);
value_test(false, ::boost::has_trivial_assign<T>::value);
value_test(false, ::boost::has_trivial_destructor<T>::value);
value_test(false, ::boost::is_empty<T>::value);
#endif
}
int cpp_main(int argc, char* argv[])
{
typedef void foo0_t();
typedef void foo1_t(int);
typedef void foo2_t(int&, double);
typedef void foo3_t(int&, bool, int, int);
typedef void foo4_t(int, bool, int*, int[], int, int, int, int, int);
is_function_tester<foo0_t>::check();
is_function_tester<foo1_t>::check();
is_function_tester<foo2_t>::check();
is_function_tester<foo3_t>::check();
is_function_tester<foo4_t>::check();
value_test(false, ::boost::is_function<void>::value);
value_test(false, ::boost::is_function<int>::value);
value_test(false, ::boost::is_function<int*>::value);
#ifndef BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION
value_test(false, ::boost::is_function<const int&>::value);
value_test(false, ::boost::is_function<int (&)(int)>::value);
#endif
value_test(false, ::boost::is_function<int[]>::value);
value_test(false, ::boost::is_function<test_abc1>::value);
value_test(false, ::boost::is_function<int (*)(int)>::value);
return check_result(argc, argv);
}
//
// define the number of failures expected for given compilers:
unsigned int expected_failures = 0;

View File

@@ -1,50 +0,0 @@
// (C) Copyright John Maddock 2000. Permission to copy, use, modify, sell and
// distribute this software is granted provided this copyright notice appears
// in all copies. This software is provided "as is" without express or implied
// warranty, and with no claim as to its suitability for any purpose.
#include <boost/type_traits/same_traits.hpp>
#include <boost/utility.hpp>
#include <boost/test/execution_monitor.hpp>
#ifdef __BORLANDC__
#pragma hrdstop
#endif
#include "boost/type_traits/type_traits_test.hpp"
int cpp_main(int argc, char* argv[])
{
value_test(true, (::boost::is_same<int, int>::value))
value_test(false, (::boost::is_same<int, const int>::value))
value_test(false, (::boost::is_same<int, int&>::value))
value_test(false, (::boost::is_same<const int, int&>::value))
value_test(false, (::boost::is_same<int, const int&>::value))
value_test(false, (::boost::is_same<int*, const int*>::value))
value_test(false, (::boost::is_same<int*, int*const>::value))
value_test(false, (::boost::is_same<int, int[2]>::value))
value_test(false, (::boost::is_same<int*, int[2]>::value))
value_test(false, (::boost::is_same<int[4], int[2]>::value))
value_test(false, (::boost::is_same<void, int>::value))
value_test(true, (::boost::is_same<void, void>::value))
value_test(false, (::boost::is_same<void, const void>::value))
#if !defined(BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION) || defined(BOOST_MSVC)
value_test(true, (::boost::is_same<test_abc1, test_abc1>::value))
value_test(false, (::boost::is_same<test_abc1, const test_abc1>::value))
#endif
return check_result(argc, argv);
}
//
// define the number of failures expected for given compilers:
#if defined(BOOST_MSVC) && _MSC_VER <= 1300
// can't separate void and cv-void:
unsigned int expected_failures = 1;
#elif defined(__SUNPRO_CC) && (__SUNPRO_CC < 0x530)
unsigned int expected_failures = 2;
#else
unsigned int expected_failures = 0;
#endif

View File

@@ -1,318 +0,0 @@
// (C) Copyright John Maddock 2000. Permission to copy, use, modify, sell and
// distribute this software is granted provided this copyright notice appears
// in all copies. This software is provided "as is" without express or implied
// warranty, and with no claim as to its suitability for any purpose.
#include <boost/type_traits/object_traits.hpp>
#include <boost/utility.hpp>
#include <boost/test/execution_monitor.hpp>
#ifdef __BORLANDC__
#pragma hrdstop
#endif
#include "boost/type_traits/type_traits_test.hpp"
NESTED_DECL(is_class)
NESTED_DECL(is_object)
NESTED_DECL(is_scalar)
NESTED_DECL(is_compound)
NESTED_DECL(is_POD)
struct non_default_constructable_UDT
{
non_default_constructable_UDT(const non_default_constructable_UDT&){}
private:
non_default_constructable_UDT(){}
};
int cpp_main(int argc, char* argv[])
{
NESTED_TEST(is_class, int)
NESTED_TEST(is_class, UDT)
NESTED_TEST(is_object, int)
NESTED_TEST(is_object, void)
NESTED_TEST(is_object, UDT)
NESTED_TEST(is_scalar, void)
NESTED_TEST(is_scalar, int)
NESTED_TEST(is_compound, int)
NESTED_TEST(is_compound, UDT)
NESTED_TEST(is_POD, int)
NESTED_TEST(is_POD, UDT)
value_test(false, boost::is_class<int>::value)
value_test(false, boost::is_class<const int>::value)
value_test(false, boost::is_class<volatile int>::value)
value_test(false, boost::is_class<int*>::value)
value_test(false, boost::is_class<int* const>::value)
value_test(false, boost::is_class<int[2]>::value)
value_test(false, boost::is_class<int&>::value)
value_test(false, boost::is_class<mf4>::value)
value_test(false, boost::is_class<f1>::value)
value_test(false, boost::is_class<enum_UDT>::value)
value_test(true, boost::is_class<UDT>::value)
value_test(true, boost::is_class<UDT const>::value)
#ifndef BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION
value_test(true, boost::is_class<test_abc1>::value)
value_test(true, boost::is_class<test_abc1 const>::value)
#endif
value_test(true, boost::is_class<UDT volatile>::value)
value_test(true, boost::is_class<empty_UDT>::value)
value_test(true, boost::is_class<std::iostream>::value)
value_test(false, boost::is_class<UDT*>::value)
value_test(false, boost::is_class<UDT[2]>::value)
value_test(false, boost::is_class<UDT&>::value)
value_test(false, boost::is_class<void>::value)
value_test(true, boost::is_object<int>::value)
value_test(true, boost::is_object<UDT>::value)
#ifndef BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION
value_test(true, boost::is_object<test_abc1>::value)
#endif
value_test(false, boost::is_object<int&>::value)
value_test(false, boost::is_object<void>::value)
value_test(true, boost::is_scalar<int>::value)
value_test(true, boost::is_scalar<void*>::value)
value_test(false, boost::is_scalar<void>::value)
value_test(false, boost::is_scalar<UDT>::value)
#ifndef BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION
value_test(false, boost::is_scalar<test_abc1>::value)
#endif
value_test(false, boost::is_scalar<int&>::value)
value_test(true, boost::is_compound<UDT>::value)
value_test(true, boost::is_compound<void*>::value)
value_test(false, boost::is_compound<void>::value)
value_test(false, boost::is_compound<int>::value)
#ifndef BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION
value_test(true, boost::is_compound<test_abc1>::value)
#endif
value_test(true, boost::is_POD<int>::value)
value_test(true, boost::is_POD<int*>::value)
value_test(false, boost::is_POD<int&>::value)
value_test(true, boost::is_POD<int*const>::value)
value_test(true, boost::is_POD<const int>::value)
value_test(true, boost::is_POD<volatile int>::value)
value_test(false, boost::is_POD<const int&>::value)
value_test(true, boost::is_POD<int[2]>::value)
value_test(true, boost::is_POD<int[3][2]>::value)
value_test(true, boost::is_POD<int[2][4][5][6][3]>::value)
value_test(true, boost::is_POD<f1>::value)
value_test(true, boost::is_POD<mf2>::value)
value_test(false, boost::is_POD<UDT>::value)
value_test(false, boost::is_POD<empty_UDT>::value)
value_test(true, boost::is_POD<enum_UDT>::value)
value_test(true, boost::is_POD<void>::value)
#ifndef BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION
value_test(false, boost::is_POD<test_abc1>::value)
#endif
value_test(true, boost::has_trivial_constructor<int>::value)
value_test(true, boost::has_trivial_constructor<int*>::value)
value_test(true, boost::has_trivial_constructor<int*const>::value)
value_test(true, boost::has_trivial_constructor<const int>::value)
value_test(true, boost::has_trivial_constructor<volatile int>::value)
value_test(true, boost::has_trivial_constructor<int[2]>::value)
value_test(true, boost::has_trivial_constructor<int[3][2]>::value)
value_test(true, boost::has_trivial_constructor<int[2][4][5][6][3]>::value)
value_test(true, boost::has_trivial_constructor<f1>::value)
value_test(true, boost::has_trivial_constructor<mf2>::value)
value_test(false, boost::has_trivial_constructor<UDT>::value)
soft_value_test(true, boost::has_trivial_constructor<empty_UDT>::value)
value_test(true, boost::has_trivial_constructor<enum_UDT>::value)
value_test(true, boost::has_trivial_constructor<void>::value)
#ifndef BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION
value_test(false, boost::has_trivial_constructor<test_abc1>::value)
#endif
value_test(true, boost::has_trivial_copy<int>::value)
value_test(true, boost::has_trivial_copy<int*>::value)
value_test(true, boost::has_trivial_copy<int*const>::value)
value_test(true, boost::has_trivial_copy<const int>::value)
// Steve: was 'false' -- should be 'true' via 3.9p3, 3.9p10
value_test(false, boost::has_trivial_copy<volatile int>::value)
value_test(true, boost::has_trivial_copy<int[2]>::value)
value_test(true, boost::has_trivial_copy<int[3][2]>::value)
value_test(true, boost::has_trivial_copy<int[2][4][5][6][3]>::value)
value_test(true, boost::has_trivial_copy<f1>::value)
value_test(true, boost::has_trivial_copy<mf2>::value)
value_test(false, boost::has_trivial_copy<UDT>::value)
soft_value_test(true, boost::has_trivial_copy<empty_UDT>::value)
value_test(true, boost::has_trivial_copy<enum_UDT>::value)
value_test(true, boost::has_trivial_copy<void>::value)
#ifndef BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION
value_test(false, boost::has_trivial_copy<test_abc1>::value)
#endif
value_test(true, boost::has_trivial_assign<int>::value)
value_test(true, boost::has_trivial_assign<int*>::value)
value_test(false, boost::has_trivial_assign<int*const>::value)
value_test(false, boost::has_trivial_assign<const int>::value)
// Steve: was 'false' -- should be 'true' via 3.9p3, 3.9p10
value_test(false, boost::has_trivial_assign<volatile int>::value)
value_test(true, boost::has_trivial_assign<int[2]>::value)
value_test(true, boost::has_trivial_assign<int[3][2]>::value)
value_test(true, boost::has_trivial_assign<int[2][4][5][6][3]>::value)
value_test(true, boost::has_trivial_assign<f1>::value)
value_test(true, boost::has_trivial_assign<mf2>::value)
value_test(false, boost::has_trivial_assign<UDT>::value)
soft_value_test(true, boost::has_trivial_assign<empty_UDT>::value)
value_test(true, boost::has_trivial_assign<enum_UDT>::value)
value_test(true, boost::has_trivial_assign<void>::value)
#ifndef BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION
value_test(false, boost::has_trivial_assign<test_abc1>::value)
#endif
value_test(true, boost::has_trivial_destructor<int>::value)
value_test(true, boost::has_trivial_destructor<int*>::value)
value_test(true, boost::has_trivial_destructor<int*const>::value)
value_test(true, boost::has_trivial_destructor<const int>::value)
value_test(true, boost::has_trivial_destructor<volatile int>::value)
value_test(true, boost::has_trivial_destructor<int[2]>::value)
value_test(true, boost::has_trivial_destructor<int[3][2]>::value)
value_test(true, boost::has_trivial_destructor<int[2][4][5][6][3]>::value)
value_test(true, boost::has_trivial_destructor<f1>::value)
value_test(true, boost::has_trivial_destructor<mf2>::value)
value_test(false, boost::has_trivial_destructor<UDT>::value)
value_test(false, boost::has_trivial_destructor<empty_UDT>::value)
value_test(true, boost::has_trivial_destructor<enum_UDT>::value)
value_test(true, boost::has_trivial_destructor<void>::value)
#ifndef BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION
value_test(false, boost::has_trivial_destructor<test_abc1>::value)
#endif
value_test(true, boost::has_nothrow_constructor<int>::value)
value_test(true, boost::has_nothrow_constructor<int*>::value)
value_test(true, boost::has_nothrow_constructor<int*const>::value)
value_test(true, boost::has_nothrow_constructor<const int>::value)
value_test(true, boost::has_nothrow_constructor<volatile int>::value)
value_test(true, boost::has_nothrow_constructor<int[2]>::value)
value_test(true, boost::has_nothrow_constructor<int[3][2]>::value)
value_test(true, boost::has_nothrow_constructor<int[2][4][5][6][3]>::value)
value_test(true, boost::has_nothrow_constructor<f1>::value)
value_test(true, boost::has_nothrow_constructor<mf2>::value)
value_test(false, boost::has_nothrow_constructor<UDT>::value)
soft_value_test(true, boost::has_nothrow_constructor<empty_UDT>::value)
value_test(true, boost::has_nothrow_constructor<enum_UDT>::value)
value_test(true, boost::has_nothrow_constructor<void>::value)
#ifndef BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION
value_test(false, boost::has_nothrow_constructor<test_abc1>::value)
#endif
value_test(true, boost::has_nothrow_copy<int>::value)
value_test(true, boost::has_nothrow_copy<int*>::value)
value_test(true, boost::has_nothrow_copy<int*const>::value)
value_test(true, boost::has_nothrow_copy<const int>::value)
// Steve: was 'false' -- should be 'true' via 3.9p3, 3.9p10
value_test(false, boost::has_nothrow_copy<volatile int>::value)
value_test(true, boost::has_nothrow_copy<int[2]>::value)
value_test(true, boost::has_nothrow_copy<int[3][2]>::value)
value_test(true, boost::has_nothrow_copy<int[2][4][5][6][3]>::value)
value_test(true, boost::has_nothrow_copy<f1>::value)
value_test(true, boost::has_nothrow_copy<mf2>::value)
value_test(false, boost::has_nothrow_copy<UDT>::value)
soft_value_test(true, boost::has_nothrow_copy<empty_UDT>::value)
value_test(true, boost::has_nothrow_copy<enum_UDT>::value)
value_test(true, boost::has_nothrow_copy<void>::value)
#ifndef BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION
value_test(false, boost::has_nothrow_copy<test_abc1>::value)
#endif
value_test(true, boost::has_nothrow_assign<int>::value)
value_test(true, boost::has_nothrow_assign<int*>::value)
value_test(false, boost::has_nothrow_assign<int*const>::value)
value_test(false, boost::has_nothrow_assign<const int>::value)
// Steve: was 'false' -- should be 'true' via 3.9p3, 3.9p10
value_test(false, boost::has_nothrow_assign<volatile int>::value)
value_test(true, boost::has_nothrow_assign<int[2]>::value)
value_test(true, boost::has_nothrow_assign<int[3][2]>::value)
value_test(true, boost::has_nothrow_assign<int[2][4][5][6][3]>::value)
value_test(true, boost::has_nothrow_assign<f1>::value)
value_test(true, boost::has_nothrow_assign<mf2>::value)
value_test(false, boost::has_nothrow_assign<UDT>::value)
soft_value_test(true, boost::has_nothrow_assign<empty_UDT>::value)
value_test(true, boost::has_nothrow_assign<enum_UDT>::value)
value_test(true, boost::has_nothrow_assign<void>::value)
#ifndef BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION
value_test(false, boost::has_nothrow_assign<test_abc1>::value)
#endif
soft_value_test(false, boost::is_empty<int>::value)
soft_value_test(false, boost::is_empty<int*>::value)
soft_value_test(false, boost::is_empty<int&>::value)
soft_value_test(false, boost::is_empty<void>::value)
#if defined(__MWERKS__) && __MWERKS__ < 0x3000 || defined(__HP_aCC)
// apparent compiler bug causes this to fail to compile:
value_fail(false, boost::is_empty<int[2]>::value)
#else
soft_value_test(false, boost::is_empty<int[2]>::value)
#endif
soft_value_test(false, boost::is_empty<f1>::value)
soft_value_test(false, boost::is_empty<mf1>::value)
soft_value_test(false, boost::is_empty<UDT>::value)
soft_value_test(true, boost::is_empty<empty_UDT>::value)
soft_value_test(true, boost::is_empty<empty_POD_UDT>::value)
// this one will not compile on most compilers,
// because we can't tell the difference between
// unions and classes:
value_fail(true, boost::is_empty<empty_union_UDT>::value)
#if defined(__MWERKS__) && __MWERKS__ < 0x3000 || defined(__HP_aCC)
// apparent compiler bug causes this to fail to compile:
value_fail(false, boost::is_empty<enum_UDT>::value)
#else
soft_value_test(false, boost::is_empty<enum_UDT>::value)
#endif
soft_value_test(true, boost::is_empty<boost::noncopyable>::value)
soft_value_test(false, boost::is_empty<non_empty>::value)
soft_value_test(false, boost::is_empty<const non_empty&>::value)
soft_value_test(true, boost::is_empty<non_default_constructable_UDT>::value)
value_test(false, (boost::is_base_and_derived<Derived,Base>::value));
value_test(true, (boost::is_base_and_derived<Derived,Derived>::value));
value_test(true, (boost::is_base_and_derived<Base,Base>::value));
value_test(true, (boost::is_base_and_derived<Base,Derived>::value));
value_test(false, (boost::is_base_and_derived<NonDerived,Base>::value));
value_test(false, (boost::is_base_and_derived<Base,void>::value));
value_test(false, (boost::is_base_and_derived<Base,const void>::value));
value_test(false, (boost::is_base_and_derived<void,Derived>::value));
value_test(false, (boost::is_base_and_derived<const void,Derived>::value));
value_test(false, (boost::is_base_and_derived<int, int>::value));
value_test(false, (boost::is_base_and_derived<const int, int>::value));
#ifndef BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION
value_test(false, (boost::is_base_and_derived<Base&,Derived>::value));
value_test(false, (boost::is_base_and_derived<Base&,Derived&>::value));
value_test(false, (boost::is_base_and_derived<Base,Derived&>::value));
value_test(false, (boost::is_base_and_derived<Base,void>::value));
#endif
return check_result(argc, argv);
}
//
// define the number of failures expected for given compilers:
#if defined(__BORLANDC__) && (__BORLANDC__ <= 0x551)
// can't handle enum's or classes that are POD's
unsigned int expected_failures = 9;
#elif defined(__SUNPRO_CC)
#if (__SUNPRO_CC <= 0x520)
unsigned int expected_failures = 55;
#elif (__SUNPRO_CC < 0x530)
unsigned int expected_failures = 25;
#else
unsigned int expected_failures = 0;
#endif
#elif defined(__MWERKS__) && __MWERKS__ < 0x3000
unsigned int expected_failures = 10;
#elif defined(BOOST_MSVC)
unsigned int expected_failures = 0;
#elif defined(__HP_aCC)
unsigned int expected_failures = 2;
#elif defined(__EDG_VERSION__) && __EDG_VERSION__ < 240
unsigned int expected_failures = 3;
#else
unsigned int expected_failures = 0;
#endif

View File

@@ -1,482 +0,0 @@
// (C) Copyright John Maddock 2000. Permission to copy, use, modify, sell and
// distribute this software is granted provided this copyright notice appears
// in all copies. This software is provided "as is" without express or implied
// warranty, and with no claim as to its suitability for any purpose.
#include <boost/type_traits/transform_traits.hpp>
#include <boost/type_traits/cv_traits.hpp>
#include <boost/utility.hpp>
#include <boost/test/execution_monitor.hpp>
#ifdef __BORLANDC__
#pragma hrdstop
#endif
//
// some of these tests, particularly those involving
// the use of the transform_check macro are tantamount
// to "compiler-abuse", and actually hide a *lot* of
// template test code. To prevent "Internal Compiler Error"
// type messages, we have to split these up into lots of
// separate functions:
#if defined(BOOST_MSVC) && BOOST_MSVC <= 1300 || (defined(__BORLANDC__) && (__BORLANDC__ < 0x550))
#define SHORT_TRANSFORM_TEST
#endif
#include "boost/type_traits/type_traits_test.hpp"
#define BOOST_DECL_TRANSFORM_TEST(name, type, from, to)\
void name(){ transform_check(type, from, to) }
#define BOOST_DECL_TRANSFORM_TEST3(name, type, from)\
void name(){ transform_check(type, from, boost_dummy_macro_param) }
#define BOOST_DECL_TRANSFORM_TEST2(name, type)\
void name(){ transform_check(type, boost_dummy_macro_param, boost_dummy_macro_param) }
/***********************************************************************
*
* tests for remove_const:
*
**********************************************************************/
BOOST_DECL_TRANSFORM_TEST3(remove_const_test_1, ::boost::remove_const, const)
BOOST_DECL_TRANSFORM_TEST(remove_const_test_2, ::boost::remove_const, volatile, volatile)
BOOST_DECL_TRANSFORM_TEST(remove_const_test_3, ::boost::remove_const, const volatile, volatile)
BOOST_DECL_TRANSFORM_TEST2(remove_const_test_4, ::boost::remove_const)
BOOST_DECL_TRANSFORM_TEST(remove_const_test_6, ::boost::remove_const, *const, *)
BOOST_DECL_TRANSFORM_TEST(remove_const_test_7, ::boost::remove_const, *volatile, *volatile)
BOOST_DECL_TRANSFORM_TEST(remove_const_test_8, ::boost::remove_const, *const volatile, *volatile)
BOOST_DECL_TRANSFORM_TEST(remove_const_test_9, ::boost::remove_const, *, *)
BOOST_DECL_TRANSFORM_TEST(remove_const_test_11, ::boost::remove_const, volatile*, volatile*)
BOOST_DECL_TRANSFORM_TEST(remove_const_test_12, ::boost::remove_const, const[2], [2])
BOOST_DECL_TRANSFORM_TEST(remove_const_test_13, ::boost::remove_const, volatile[2], volatile[2])
BOOST_DECL_TRANSFORM_TEST(remove_const_test_14, ::boost::remove_const, const volatile[2], volatile[2])
BOOST_DECL_TRANSFORM_TEST(remove_const_test_15, ::boost::remove_const, [2], [2])
BOOST_DECL_TRANSFORM_TEST(remove_const_test_16, ::boost::remove_const, const*, const*)
BOOST_DECL_TRANSFORM_TEST(remove_const_test_17, ::boost::remove_const, const*const, const*)
void check_remove_const()
{
remove_const_test_1();
remove_const_test_2();
remove_const_test_3();
remove_const_test_4();
remove_const_test_6();
remove_const_test_7();
remove_const_test_8();
remove_const_test_9();
remove_const_test_11();
remove_const_test_12();
remove_const_test_13();
remove_const_test_14();
remove_const_test_15();
remove_const_test_16();
remove_const_test_17();
}
/***********************************************************************
*
* tests for remove_volatile:
*
**********************************************************************/
BOOST_DECL_TRANSFORM_TEST(remove_volatile_test_1, ::boost::remove_volatile, const, const)
BOOST_DECL_TRANSFORM_TEST3(remove_volatile_test_2, ::boost::remove_volatile, volatile)
BOOST_DECL_TRANSFORM_TEST(remove_volatile_test_3, ::boost::remove_volatile, const volatile, const)
BOOST_DECL_TRANSFORM_TEST2(remove_volatile_test_4, ::boost::remove_volatile)
BOOST_DECL_TRANSFORM_TEST2(remove_volatile_test_5, ::boost::remove_volatile)
BOOST_DECL_TRANSFORM_TEST(remove_volatile_test_6, ::boost::remove_volatile, *const, *const)
BOOST_DECL_TRANSFORM_TEST(remove_volatile_test_7, ::boost::remove_volatile, *volatile, *)
BOOST_DECL_TRANSFORM_TEST(remove_volatile_test_8, ::boost::remove_volatile, *const volatile, *const)
BOOST_DECL_TRANSFORM_TEST(remove_volatile_test_9, ::boost::remove_volatile, *, *)
BOOST_DECL_TRANSFORM_TEST(remove_volatile_test_10, ::boost::remove_volatile, *, *)
BOOST_DECL_TRANSFORM_TEST(remove_volatile_test_11, ::boost::remove_volatile, volatile*, volatile*)
BOOST_DECL_TRANSFORM_TEST(remove_volatile_test_12, ::boost::remove_volatile, const[2], const[2])
BOOST_DECL_TRANSFORM_TEST(remove_volatile_test_13, ::boost::remove_volatile, volatile[2], [2])
BOOST_DECL_TRANSFORM_TEST(remove_volatile_test_14, ::boost::remove_volatile, const volatile[2], const[2])
BOOST_DECL_TRANSFORM_TEST(remove_volatile_test_15, ::boost::remove_volatile, [2], [2])
BOOST_DECL_TRANSFORM_TEST(remove_volatile_test_16, ::boost::remove_volatile, const*, const*)
BOOST_DECL_TRANSFORM_TEST(remove_volatile_test_17, ::boost::remove_volatile, const*volatile, const*)
void check_remove_volatile()
{
remove_volatile_test_1();
remove_volatile_test_2();
remove_volatile_test_3();
remove_volatile_test_4();
remove_volatile_test_5();
remove_volatile_test_6();
remove_volatile_test_7();
remove_volatile_test_8();
remove_volatile_test_9();
remove_volatile_test_10();
remove_volatile_test_11();
remove_volatile_test_12();
remove_volatile_test_13();
remove_volatile_test_14();
remove_volatile_test_15();
remove_volatile_test_16();
remove_volatile_test_17();
}
/***********************************************************************
*
* tests for remove_cv:
*
**********************************************************************/
BOOST_DECL_TRANSFORM_TEST3(remove_cv_test_1, ::boost::remove_cv, const)
BOOST_DECL_TRANSFORM_TEST3(remove_cv_test_2, ::boost::remove_cv, volatile)
BOOST_DECL_TRANSFORM_TEST3(remove_cv_test_3, ::boost::remove_cv, const volatile)
BOOST_DECL_TRANSFORM_TEST2(remove_cv_test_4, ::boost::remove_cv)
BOOST_DECL_TRANSFORM_TEST(remove_cv_test_5, ::boost::remove_cv, const &, const&)
BOOST_DECL_TRANSFORM_TEST(remove_cv_test_6, ::boost::remove_cv, *const, *)
BOOST_DECL_TRANSFORM_TEST(remove_cv_test_7, ::boost::remove_cv, *volatile, *)
BOOST_DECL_TRANSFORM_TEST(remove_cv_test_8, ::boost::remove_cv, *const volatile, *)
BOOST_DECL_TRANSFORM_TEST(remove_cv_test_9, ::boost::remove_cv, *, *)
BOOST_DECL_TRANSFORM_TEST(remove_cv_test_10, ::boost::remove_cv, const*, const*)
BOOST_DECL_TRANSFORM_TEST(remove_cv_test_11, ::boost::remove_cv, volatile*, volatile*)
BOOST_DECL_TRANSFORM_TEST(remove_cv_test_12, ::boost::remove_cv, const[2], [2])
BOOST_DECL_TRANSFORM_TEST(remove_cv_test_13, ::boost::remove_cv, volatile[2], [2])
BOOST_DECL_TRANSFORM_TEST(remove_cv_test_14, ::boost::remove_cv, const volatile[2], [2])
BOOST_DECL_TRANSFORM_TEST(remove_cv_test_15, ::boost::remove_cv, [2], [2])
BOOST_DECL_TRANSFORM_TEST(remove_cv_test_16, ::boost::remove_cv, const*, const*)
BOOST_DECL_TRANSFORM_TEST(remove_cv_test_17, ::boost::remove_cv, const*volatile, const*)
void check_remove_cv()
{
remove_cv_test_1();
remove_cv_test_2();
remove_cv_test_3();
remove_cv_test_4();
remove_cv_test_5();
remove_cv_test_6();
remove_cv_test_7();
remove_cv_test_8();
remove_cv_test_9();
remove_cv_test_10();
remove_cv_test_11();
remove_cv_test_12();
remove_cv_test_13();
remove_cv_test_14();
remove_cv_test_15();
remove_cv_test_16();
remove_cv_test_17();
}
/***********************************************************************
*
* tests for remove_reference:
*
**********************************************************************/
BOOST_DECL_TRANSFORM_TEST(remove_reference_test_1, ::boost::remove_reference, const, const)
BOOST_DECL_TRANSFORM_TEST(remove_reference_test_2, ::boost::remove_reference, volatile, volatile)
BOOST_DECL_TRANSFORM_TEST3(remove_reference_test_3, ::boost::remove_reference, &)
BOOST_DECL_TRANSFORM_TEST2(remove_reference_test_4, ::boost::remove_reference)
BOOST_DECL_TRANSFORM_TEST(remove_reference_test_5, ::boost::remove_reference, const &, const)
BOOST_DECL_TRANSFORM_TEST(remove_reference_test_6, ::boost::remove_reference, *, *)
BOOST_DECL_TRANSFORM_TEST(remove_reference_test_7, ::boost::remove_reference, *volatile, *volatile)
BOOST_DECL_TRANSFORM_TEST3(remove_reference_test_8, ::boost::remove_reference, &)
BOOST_DECL_TRANSFORM_TEST(remove_reference_test_9, ::boost::remove_reference, const &, const)
BOOST_DECL_TRANSFORM_TEST(remove_reference_test_10, ::boost::remove_reference, const*, const*)
BOOST_DECL_TRANSFORM_TEST(remove_reference_test_11, ::boost::remove_reference, volatile*, volatile*)
BOOST_DECL_TRANSFORM_TEST(remove_reference_test_12, ::boost::remove_reference, const[2], const[2])
BOOST_DECL_TRANSFORM_TEST(remove_reference_test_13, ::boost::remove_reference, (&)[2], [2])
void check_remove_reference()
{
remove_reference_test_1();
remove_reference_test_2();
remove_reference_test_3();
remove_reference_test_4();
remove_reference_test_5();
remove_reference_test_6();
remove_reference_test_7();
remove_reference_test_8();
remove_reference_test_9();
remove_reference_test_10();
remove_reference_test_11();
remove_reference_test_12();
remove_reference_test_13();
}
/***********************************************************************
*
* tests for remove_bounds:
*
**********************************************************************/
BOOST_DECL_TRANSFORM_TEST(remove_bounds_test_1, ::boost::remove_bounds, const, const)
BOOST_DECL_TRANSFORM_TEST(remove_bounds_test_2, ::boost::remove_bounds, volatile, volatile)
BOOST_DECL_TRANSFORM_TEST3(remove_bounds_test_3, ::boost::remove_bounds, [2])
BOOST_DECL_TRANSFORM_TEST2(remove_bounds_test_4, ::boost::remove_bounds)
BOOST_DECL_TRANSFORM_TEST(remove_bounds_test_5, ::boost::remove_bounds, const &, const&)
BOOST_DECL_TRANSFORM_TEST(remove_bounds_test_6, ::boost::remove_bounds, *, *)
BOOST_DECL_TRANSFORM_TEST(remove_bounds_test_7, ::boost::remove_bounds, *volatile, *volatile)
BOOST_DECL_TRANSFORM_TEST(remove_bounds_test_8, ::boost::remove_bounds, const [2], const)
BOOST_DECL_TRANSFORM_TEST(remove_bounds_test_9, ::boost::remove_bounds, const &, const&)
BOOST_DECL_TRANSFORM_TEST(remove_bounds_test_10, ::boost::remove_bounds, const*, const*)
BOOST_DECL_TRANSFORM_TEST(remove_bounds_test_11, ::boost::remove_bounds, volatile*, volatile*)
BOOST_DECL_TRANSFORM_TEST(remove_bounds_test_12, ::boost::remove_bounds, const[2][3], const[3])
BOOST_DECL_TRANSFORM_TEST(remove_bounds_test_13, ::boost::remove_bounds, (&)[2], (&)[2])
void check_remove_bounds()
{
remove_bounds_test_1();
remove_bounds_test_2();
remove_bounds_test_3();
remove_bounds_test_4();
remove_bounds_test_5();
remove_bounds_test_6();
remove_bounds_test_7();
remove_bounds_test_8();
remove_bounds_test_9();
remove_bounds_test_10();
remove_bounds_test_11();
remove_bounds_test_12();
remove_bounds_test_13();
}
/***********************************************************************
*
* tests for remove_pointer:
*
**********************************************************************/
BOOST_DECL_TRANSFORM_TEST(remove_pointer_test_1, ::boost::remove_pointer, const, const)
BOOST_DECL_TRANSFORM_TEST(remove_pointer_test_2, ::boost::remove_pointer, volatile, volatile)
BOOST_DECL_TRANSFORM_TEST3(remove_pointer_test_3, ::boost::remove_pointer, *)
BOOST_DECL_TRANSFORM_TEST2(remove_pointer_test_4, ::boost::remove_pointer)
BOOST_DECL_TRANSFORM_TEST(remove_pointer_test_5, ::boost::remove_pointer, const &, const&)
BOOST_DECL_TRANSFORM_TEST(remove_pointer_test_6, ::boost::remove_pointer, &, &)
BOOST_DECL_TRANSFORM_TEST3(remove_pointer_test_7, ::boost::remove_pointer, *volatile)
BOOST_DECL_TRANSFORM_TEST(remove_pointer_test_8, ::boost::remove_pointer, const [2], const[2])
BOOST_DECL_TRANSFORM_TEST(remove_pointer_test_9, ::boost::remove_pointer, const &, const&)
BOOST_DECL_TRANSFORM_TEST(remove_pointer_test_10, ::boost::remove_pointer, const*, const)
BOOST_DECL_TRANSFORM_TEST(remove_pointer_test_11, ::boost::remove_pointer, volatile*, volatile)
BOOST_DECL_TRANSFORM_TEST(remove_pointer_test_12, ::boost::remove_pointer, const[2][3], const[2][3])
BOOST_DECL_TRANSFORM_TEST(remove_pointer_test_13, ::boost::remove_pointer, (&)[2], (&)[2])
void check_remove_pointer()
{
remove_pointer_test_1();
remove_pointer_test_2();
remove_pointer_test_3();
remove_pointer_test_4();
remove_pointer_test_5();
remove_pointer_test_6();
remove_pointer_test_7();
remove_pointer_test_8();
remove_pointer_test_9();
remove_pointer_test_10();
remove_pointer_test_11();
remove_pointer_test_12();
remove_pointer_test_13();
}
/***********************************************************************
*
* tests for add_reference:
*
**********************************************************************/
BOOST_DECL_TRANSFORM_TEST(add_reference_test_1, ::boost::add_reference, const, const&)
BOOST_DECL_TRANSFORM_TEST(add_reference_test_2, ::boost::add_reference, volatile, volatile&)
BOOST_DECL_TRANSFORM_TEST(add_reference_test_3, ::boost::add_reference, *, *&)
//BOOST_DECL_TRANSFORM_TEST2(add_reference_test_4, ::boost::add_reference)
BOOST_DECL_TRANSFORM_TEST(add_reference_test_5, ::boost::add_reference, const &, const&)
BOOST_DECL_TRANSFORM_TEST(add_reference_test_6, ::boost::add_reference, &, &)
BOOST_DECL_TRANSFORM_TEST(add_reference_test_7, ::boost::add_reference, *volatile, *volatile&)
BOOST_DECL_TRANSFORM_TEST(add_reference_test_8, ::boost::add_reference, const [2], const (&)[2])
BOOST_DECL_TRANSFORM_TEST(add_reference_test_9, ::boost::add_reference, const &, const&)
BOOST_DECL_TRANSFORM_TEST(add_reference_test_10, ::boost::add_reference, const*, const*&)
BOOST_DECL_TRANSFORM_TEST(add_reference_test_11, ::boost::add_reference, volatile*, volatile*&)
//BOOST_DECL_TRANSFORM_TEST(add_reference_test_12, ::boost::add_reference, const[2][3], const (&)[2][3])
BOOST_DECL_TRANSFORM_TEST(add_reference_test_13, ::boost::add_reference, (&)[2], (&)[2])
void check_add_reference()
{
add_reference_test_1();
add_reference_test_2();
add_reference_test_3();
//add_reference_test_4();
add_reference_test_5();
add_reference_test_6();
add_reference_test_7();
add_reference_test_8();
add_reference_test_9();
add_reference_test_10();
add_reference_test_11();
//add_reference_test_12();
add_reference_test_13();
}
/***********************************************************************
*
* tests for add_pointer:
*
**********************************************************************/
BOOST_DECL_TRANSFORM_TEST(add_pointer_test_1, ::boost::add_pointer, const, const*)
BOOST_DECL_TRANSFORM_TEST(add_pointer_test_2, ::boost::add_pointer, volatile, volatile*)
BOOST_DECL_TRANSFORM_TEST(add_pointer_test_3, ::boost::add_pointer, *, **)
//BOOST_DECL_TRANSFORM_TEST2(add_pointer_test_4, ::boost::add_pointer)
BOOST_DECL_TRANSFORM_TEST(add_pointer_test_7, ::boost::add_pointer, *volatile, *volatile*)
BOOST_DECL_TRANSFORM_TEST(add_pointer_test_10, ::boost::add_pointer, const*, const**)
BOOST_DECL_TRANSFORM_TEST(add_pointer_test_11, ::boost::add_pointer, volatile*, volatile**)
#ifndef BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION
BOOST_DECL_TRANSFORM_TEST(add_pointer_test_5, ::boost::add_pointer, const &, const*)
BOOST_DECL_TRANSFORM_TEST(add_pointer_test_6, ::boost::add_pointer, &, *)
BOOST_DECL_TRANSFORM_TEST(add_pointer_test_8, ::boost::add_pointer, const [2], const (*)[2])
BOOST_DECL_TRANSFORM_TEST(add_pointer_test_9, ::boost::add_pointer, const &, const*)
BOOST_DECL_TRANSFORM_TEST(add_pointer_test_12, ::boost::add_pointer, const[2][3], const (*)[2][3])
BOOST_DECL_TRANSFORM_TEST(add_pointer_test_13, ::boost::add_pointer, (&)[2], (*)[2])
#endif
void check_add_pointer()
{
add_pointer_test_1();
add_pointer_test_2();
add_pointer_test_3();
//add_pointer_test_4();
add_pointer_test_7();
add_pointer_test_10();
add_pointer_test_11();
#ifndef BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION
add_pointer_test_5();
add_pointer_test_6();
add_pointer_test_8();
add_pointer_test_9();
add_pointer_test_12();
add_pointer_test_13();
#endif
}
/***********************************************************************
*
* tests for add_const:
*
**********************************************************************/
BOOST_DECL_TRANSFORM_TEST(add_const_test_1, ::boost::add_const, const, const)
BOOST_DECL_TRANSFORM_TEST(add_const_test_2, ::boost::add_const, volatile, volatile const)
BOOST_DECL_TRANSFORM_TEST(add_const_test_3, ::boost::add_const, *, *const)
//BOOST_DECL_TRANSFORM_TEST2(add_const_test_4, ::boost::add_const)
BOOST_DECL_TRANSFORM_TEST(add_const_test_7, ::boost::add_const, *volatile, *volatile const)
BOOST_DECL_TRANSFORM_TEST(add_const_test_10, ::boost::add_const, const*, const*const)
BOOST_DECL_TRANSFORM_TEST(add_const_test_11, ::boost::add_const, volatile*, volatile*const)
BOOST_DECL_TRANSFORM_TEST(add_const_test_5, ::boost::add_const, const &, const&)
BOOST_DECL_TRANSFORM_TEST(add_const_test_6, ::boost::add_const, &, &)
BOOST_DECL_TRANSFORM_TEST(add_const_test_8, ::boost::add_const, const [2], const [2])
BOOST_DECL_TRANSFORM_TEST(add_const_test_9, ::boost::add_const, volatile &, volatile&)
BOOST_DECL_TRANSFORM_TEST(add_const_test_12, ::boost::add_const, [2][3], const[2][3])
BOOST_DECL_TRANSFORM_TEST(add_const_test_13, ::boost::add_const, (&)[2], (&)[2])
void check_add_const()
{
add_const_test_1();
add_const_test_2();
add_const_test_3();
//add_const_test_4();
add_const_test_7();
add_const_test_10();
add_const_test_11();
add_const_test_5();
add_const_test_6();
add_const_test_8();
add_const_test_9();
add_const_test_12();
add_const_test_13();
}
/***********************************************************************
*
* tests for add_volatile:
*
**********************************************************************/
BOOST_DECL_TRANSFORM_TEST(add_volatile_test_1, ::boost::add_volatile, const, const volatile)
BOOST_DECL_TRANSFORM_TEST(add_volatile_test_2, ::boost::add_volatile, volatile, volatile)
BOOST_DECL_TRANSFORM_TEST(add_volatile_test_3, ::boost::add_volatile, *, *volatile)
//BOOST_DECL_TRANSFORM_TEST2(add_volatile_test_4, ::boost::add_volatile)
BOOST_DECL_TRANSFORM_TEST(add_volatile_test_7, ::boost::add_volatile, *volatile, *volatile)
BOOST_DECL_TRANSFORM_TEST(add_volatile_test_10, ::boost::add_volatile, const*, const*volatile)
BOOST_DECL_TRANSFORM_TEST(add_volatile_test_11, ::boost::add_volatile, volatile*, volatile*volatile)
BOOST_DECL_TRANSFORM_TEST(add_volatile_test_5, ::boost::add_volatile, const &, const&)
BOOST_DECL_TRANSFORM_TEST(add_volatile_test_6, ::boost::add_volatile, &, &)
BOOST_DECL_TRANSFORM_TEST(add_volatile_test_8, ::boost::add_volatile, const [2], const volatile [2])
BOOST_DECL_TRANSFORM_TEST(add_volatile_test_9, ::boost::add_volatile, volatile &, volatile&)
BOOST_DECL_TRANSFORM_TEST(add_volatile_test_12, ::boost::add_volatile, [2][3], volatile[2][3])
BOOST_DECL_TRANSFORM_TEST(add_volatile_test_13, ::boost::add_volatile, (&)[2], (&)[2])
void check_add_volatile()
{
add_volatile_test_1();
add_volatile_test_2();
add_volatile_test_3();
//add_volatile_test_4();
add_volatile_test_7();
add_volatile_test_10();
add_volatile_test_11();
add_volatile_test_5();
add_volatile_test_6();
add_volatile_test_8();
add_volatile_test_9();
add_volatile_test_12();
add_volatile_test_13();
}
int cpp_main(int argc, char* argv[])
{
check_remove_const();
check_remove_volatile();
check_remove_cv();
check_remove_reference();
check_remove_bounds();
check_remove_pointer();
check_add_reference();
check_add_pointer();
check_add_const();
check_add_volatile();
type_test(void, boost::remove_const<void>::type)
type_test(void, boost::remove_volatile<void>::type)
type_test(void, boost::remove_cv<void>::type)
type_test(int, boost::remove_reference<cr_type>::type)
type_test(void, boost::remove_reference<void>::type)
type_test(void, boost::remove_bounds<void>::type)
type_test(void, boost::remove_pointer<void>::type)
return check_result(argc, argv);
}
//
// define the number of failures expected for given compilers:
#ifdef __BORLANDC__
# ifdef SHORT_TRANSFORM_TEST
unsigned int expected_failures = 97; // cv-qualifiers
# else
unsigned int expected_failures = 474; // cv-qualifiers
# endif
#elif defined(BOOST_MSVC) && _MSC_VER <= 1300
unsigned int expected_failures = 84; // partial specialisation (fails for UDT's)
#elif defined(__SUNPRO_CC)
unsigned int expected_failures = 1; // cv-qualified references
#elif defined(__GNUC__)
# if (__GNUC__ > 3) || (__GNUC__ == 3 && __GNUC_MINOR__ >= 1)
unsigned int expected_failures = 0;
# else
unsigned int expected_failures = 1; // cv-qualified references
# endif
#elif defined(__HP_aCC)
unsigned int expected_failures = 272; // remove_const/remove_volatile/remove_cv don't work
#elif defined(__EDG_VERSION__) && __EDG_VERSION__ < 238
unsigned int expected_failures = 1;
#else
unsigned int expected_failures = 0;
#endif