// (C) Copyright John Maddock 2000. // Use, modification and distribution are subject to the // Boost Software License, Version 1.0. (See accompanying file // LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) #include "test.hpp" #include "check_integral_constant.hpp" #ifdef TEST_STD # include #else #include #include #include #include #include #include #include #include #include #include #include #include #include #endif #include #include #include // // VC++ emits an awful lot of warnings unless we define these: #ifdef BOOST_MSVC # pragma warning(disable:4244) #endif template struct align_calc { char padding; T instance; static std::ptrdiff_t get() { static align_calc a; return reinterpret_cast(&(a.instance)) - reinterpret_cast(&(a.padding)); } }; #define ALIGNOF(x) align_calc::get() TT_TEST_BEGIN(tricky_partial_specialization_test) // // corner cases which don't compile without partial specialization // support: // BOOST_CHECK_INTEGRAL_CONSTANT(::tt::alignment_of::value, ALIGNOF(void*)); BOOST_CHECK_INTEGRAL_CONSTANT(::tt::alignment_of::value, ALIGNOF(void*)); BOOST_CHECK_INTEGRAL_CONSTANT(::tt::alignment_of::value, ALIGNOF(void*)); BOOST_CHECK_INTEGRAL_CONSTANT((::tt::is_base_of::value), false); BOOST_CHECK_INTEGRAL_CONSTANT((::tt::is_base_of::value), false); BOOST_CHECK_INTEGRAL_CONSTANT((::tt::is_base_of::value), false); BOOST_CHECK_INTEGRAL_CONSTANT((::tt::is_base_of::value), false); #ifndef BOOST_NO_RVALUE_REFERENCES BOOST_CHECK_INTEGRAL_CONSTANT((::tt::is_base_of::value), false); BOOST_CHECK_INTEGRAL_CONSTANT((::tt::is_base_of::value), false); BOOST_CHECK_INTEGRAL_CONSTANT((::tt::is_base_of::value), false); #endif BOOST_CHECK_INTEGRAL_CONSTANT((::tt::is_same::value), false); BOOST_CHECK_INTEGRAL_CONSTANT((::tt::is_same::value), true); BOOST_CHECK_INTEGRAL_CONSTANT((::tt::is_same::value), false); BOOST_CHECK_INTEGRAL_CONSTANT((::tt::is_same::value), true); BOOST_CHECK_INTEGRAL_CONSTANT((::tt::is_same::value), false); BOOST_CHECK_INTEGRAL_CONSTANT((::tt::is_convertible::value), false); BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_polymorphic::value, false); BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_polymorphic::value, false); BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_polymorphic::value, true); BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_polymorphic::value, true); BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_polymorphic::value, true); BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_polymorphic::value, true); BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_polymorphic::value, true); BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_polymorphic::value, true); BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_polymorphic::value, true); BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_polymorphic::value, true); BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_polymorphic::value, true); BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_pointer::value, true); BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_pointer::value, true); BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_pointer::value, true); BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_member_pointer::value, false); BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_member_pointer::value, true); BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_member_pointer::value, true); BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_member_pointer::value, true); BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_member_pointer::value, true); BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_member_pointer::value, true); BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_member_pointer::value, true); BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_member_object_pointer::value, false); BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_member_object_pointer::value, true); BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_member_object_pointer::value, true); BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_member_object_pointer::value, true); BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_member_object_pointer::value, false); BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_member_object_pointer::value, false); BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_member_object_pointer::value, false); BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_member_function_pointer::value, false); BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_member_function_pointer::value, false); BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_member_function_pointer::value, false); BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_member_function_pointer::value, false); BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_member_function_pointer::value, true); BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_member_function_pointer::value, true); BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_member_function_pointer::value, true); TT_TEST_END