From 616ab1ec7b5ad59e4a0d50f114b0ecd88ac4ba15 Mon Sep 17 00:00:00 2001 From: John Maddock Date: Mon, 8 Oct 2001 11:33:02 +0000 Subject: [PATCH] Misc fixes for sunpro 5.3 [SVN r11357] --- .../boost/type_traits/alignment_traits.hpp | 2 +- .../boost/type_traits/type_traits_test.hpp | 21 +++++++------------ 2 files changed, 9 insertions(+), 14 deletions(-) diff --git a/include/boost/type_traits/alignment_traits.hpp b/include/boost/type_traits/alignment_traits.hpp index 52af79a..c71565a 100644 --- a/include/boost/type_traits/alignment_traits.hpp +++ b/include/boost/type_traits/alignment_traits.hpp @@ -56,7 +56,7 @@ template struct alignment_of { public: - BOOST_STATIC_CONSTANT(std::size_t, value = alignment_of::value); + BOOST_STATIC_CONSTANT(std::size_t, value = ::boost::alignment_of::value); }; #endif // diff --git a/include/boost/type_traits/type_traits_test.hpp b/include/boost/type_traits/type_traits_test.hpp index b96feab..5c63f11 100644 --- a/include/boost/type_traits/type_traits_test.hpp +++ b/include/boost/type_traits/type_traits_test.hpp @@ -41,7 +41,7 @@ int check_result(int argc, char** argv) std::cout << "Press any key to continue..."; std::cin.get(); } - return (failures == expected_failures) ? 0 : failures; + return (failures <= expected_failures) ? 0 : failures; } @@ -72,28 +72,23 @@ struct checker } }; +template +struct typify{}; + template struct type_checker { static void check(const char* TT, const char* TU, const char* expression) { ++test_count; -#ifdef BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION - if((typeid(T) != typeid(U)) - || (::boost::is_reference::value != ::boost::is_reference::value) - || (::boost::is_const::value != ::boost::is_const::value) - || (::boost::is_volatile::value != ::boost::is_volatile::value)) + if(typeid(typify) != typeid(typify)) { -#endif ++failures; std::cout << "checking type of " << expression << "...failed" << std::endl; - std::cout << " expected type was " << TT << std::endl; - std::cout << " typeid(" << TT << ") was: " << typeid(T).name() << std::endl; - std::cout << " typeid(" << TU << ") was: " << typeid(U).name() << std::endl; - std::cout << " In template class " << typeid(type_checker).name() << std::endl; -#ifdef BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION + std::cout << " evaluating: type_checker<" << TT << "," << expression << ">" << std::endl; + std::cout << " expected: type_checker<" << TT << "," << TT << ">" << std::endl; + std::cout << " but got: " << typeid(type_checker).name() << std::endl; } -#endif } };