diff --git a/call_traits_test.cpp b/call_traits_test.cpp index 710657a..430ce4d 100644 --- a/call_traits_test.cpp +++ b/call_traits_test.cpp @@ -116,7 +116,7 @@ void checker::operator()(param_type p) assert(t == c.get()); assert(t == c.const_get()); - cout << "typeof contained<" << typeid(T).name() << ">::v_ is: " << typeid(&contained::v_).name() << endl; + //cout << "typeof contained<" << typeid(T).name() << ">::v_ is: " << typeid(&contained::v_).name() << endl; cout << "typeof contained<" << typeid(T).name() << ">::value() is: " << typeid(&contained::value).name() << endl; cout << "typeof contained<" << typeid(T).name() << ">::get() is: " << typeid(&contained::get).name() << endl; cout << "typeof contained<" << typeid(T).name() << ">::const_get() is: " << typeid(&contained::const_get).name() << endl; @@ -190,17 +190,18 @@ int main() int i = 2; c2(i); int* pi = &i; +#if defined(BOOST_MSVC6_MEMBER_TEMPLATES) || !defined(BOOST_NO_MEMBER_TEMPLATES) checker c3; c3(pi); -#ifndef BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION checker c4; c4(i); checker c5; c5(i); - +#if !defined (BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION) int a[2] = {1,2}; checker c6; c6(a); +#endif #endif check_wrap(wrap(2), 2); @@ -229,7 +230,7 @@ int main() type_test(int*&, boost::call_traits::reference) type_test(int*const&, boost::call_traits::const_reference) type_test(int*const, boost::call_traits::param_type) -#ifndef BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION +#if defined(BOOST_MSVC6_MEMBER_TEMPLATES) || !defined(BOOST_NO_MEMBER_TEMPLATES) type_test(int&, boost::call_traits::value_type) type_test(int&, boost::call_traits::reference) type_test(const int&, boost::call_traits::const_reference) @@ -248,6 +249,7 @@ int main() type_test(const int&, boost::call_traits::reference) type_test(const int&, boost::call_traits::const_reference) type_test(const int&, boost::call_traits::param_type) +#ifndef BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION type_test(const int*, boost::call_traits::value_type) type_test(int(&)[3], boost::call_traits::reference) type_test(const int(&)[3], boost::call_traits::const_reference) @@ -256,6 +258,11 @@ int main() type_test(const int(&)[3], boost::call_traits::reference) type_test(const int(&)[3], boost::call_traits::const_reference) type_test(const int*const, boost::call_traits::param_type) +#else + std::cout << "You're compiler does not support partial template instantiation, skipping 8 tests (8 errors)" << std::endl; + failures += 8; + test_count += 8; +#endif #else std::cout << "You're compiler does not support partial template instantiation, skipping 20 tests (20 errors)" << std::endl; failures += 20; @@ -347,9 +354,11 @@ void call_traits_test::assert_construct(boost::call_traits::param_ty template struct call_traits_test; template struct call_traits_test; template struct call_traits_test; -#ifndef BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION +#if defined(BOOST_MSVC6_MEMBER_TEMPLATES) || !defined(BOOST_NO_MEMBER_TEMPLATES) template struct call_traits_test; template struct call_traits_test; +#ifndef BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION template struct call_traits_test; #endif +#endif diff --git a/type_traits_test.cpp b/type_traits_test.cpp index 719b2d1..2a48ecf 100644 --- a/type_traits_test.cpp +++ b/type_traits_test.cpp @@ -169,6 +169,7 @@ struct VD : VB // not considering cv-qual's as a part of the type -- they are considered // compiler hints only. These failures should be fixed before long. + int main() { std::cout << "Checking type operations..." << std::endl << std::endl; diff --git a/type_traits_test.hpp b/type_traits_test.hpp index 3e0b44e..9b3e157 100644 --- a/type_traits_test.hpp +++ b/type_traits_test.hpp @@ -30,13 +30,17 @@ struct ct_checker }; #define BOOST_DO_JOIN( X, Y ) BOOST_DO_JOIN2(X,Y) -#define BOOST_DO_JOIN2(X, Y) 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;\ + 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