diff --git a/operators.htm b/operators.htm index f97498c..9812692 100644 --- a/operators.htm +++ b/operators.htm @@ -585,7 +585,7 @@ complicated than the old one, we think it's worth it to make the library more useful in real world. Alexy Gurtovoy contributed the code which supports the new usage idiom while allowing the library remain backward-compatible.


-

Revised 27 Sep 2000

+

Revised 28 Sep 2000

© Copyright David Abrahams and Beman Dawes 1999-2000. Permission to copy, use, modify, sell and distribute this document is granted provided this copyright notice appears in all copies. This document is provided "as diff --git a/type_traits_test.hpp b/type_traits_test.hpp deleted file mode 100644 index e86b83e..0000000 --- a/type_traits_test.hpp +++ /dev/null @@ -1,114 +0,0 @@ -// boost::compressed_pair test program - -// (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. - -// common test code for type_traits_test.cpp/call_traits_test.cpp/compressed_pair_test.cpp - - -#ifndef BOOST_TYPE_TRAITS_TEST_HPP -#define BOOST_TYPE_TRAITS_TEST_HPP - -// Variable declarations must come before test_align due to two-phase lookup -unsigned failures = 0; -unsigned test_count = 0; - -// -// this one is here just to suppress warnings: -// -template -bool do_compare(T i, T j) -{ - return i == j; -} - -// -// this one is to verify that a constant is indeed a -// constant-integral-expression: -// -template -struct ct_checker -{ -}; - -#define BOOST_DO_JOIN( X, Y ) BOOST_DO_JOIN2(X,Y) -#define BOOST_DO_JOIN2(X, Y) X##Y -#define BOOST_JOIN( X, Y ) BOOST_DO_JOIN( X, Y ) - -#ifdef BOOST_MSVC -#define value_test(v, x) ++test_count;\ - {typedef ct_checker<(x)> this_is_a_compile_time_check_;}\ - if(!do_compare((int)v,(int)x)){++failures; std::cout << "checking value of " << #x << "...failed" << std::endl;} -#else -#define value_test(v, x) ++test_count;\ - typedef ct_checker<(x)> BOOST_JOIN(this_is_a_compile_time_check_, __LINE__);\ - if(!do_compare((int)v,(int)x)){++failures; std::cout << "checking value of " << #x << "...failed" << std::endl;} -#endif -#define value_fail(v, x) ++test_count; ++failures; std::cout << "checking value of " << #x << "...failed" << std::endl; - -#ifndef BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION -#define type_test(v, x) ++test_count;\ - if(do_compare(boost::is_same::value, false)){\ - ++failures; \ - std::cout << "checking type of " << #x << "...failed" << std::endl; \ - std::cout << " expected type was " << #v << std::endl; \ - std::cout << " " << typeid(boost::is_same).name() << "::value is false" << std::endl; } -#else -#define type_test(v, x) ++test_count;\ - if(typeid(v) != typeid(x)){\ - ++failures; \ - std::cout << "checking type of " << #x << "...failed" << std::endl; \ - std::cout << " expected type was " << #v << std::endl; \ - std::cout << " " << "typeid(" #v ") != typeid(" #x ")" << std::endl; } -#endif - -template -struct test_align -{ - struct padded - { - char c; - T t; - }; - static void do_it() - { - padded p; - unsigned a = reinterpret_cast(&(p.t)) - reinterpret_cast(&p); - value_test(a, boost::alignment_of::value); - } -}; -#ifndef BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION -template -struct test_align -{ - static void do_it() - { - // - // we can't do the usual test because we can't take the address - // of a reference, so check that the result is the same as for a - // pointer type instead: - value_test(boost::alignment_of::value, boost::alignment_of::value); - } -}; -#endif - -#define align_test(T) test_align::do_it() - -// -// define tests here - -// -// turn off some warnings: -#ifdef __BORLANDC__ -#pragma option -w-8004 -#endif - -#ifdef BOOST_MSVC -#pragma warning (disable: 4018) -#endif - - -#endif // BOOST_TYPE_TRAITS_TEST_HPP -