changes after pre-review

[SVN r1503]
This commit is contained in:
Jaakko Järvi
2003-09-05 18:22:13 +00:00
parent ef515c76c9
commit b007400de4
9 changed files with 150 additions and 22 deletions
+23 -2
View File
@@ -14,6 +14,8 @@
#include <boost/utility/enable_if.hpp>
#include <boost/type_traits/is_arithmetic.hpp>
using boost::enable_if_c;
using boost::disable_if_c;
using boost::enable_if;
using boost::disable_if;
using boost::is_arithmetic;
@@ -22,12 +24,25 @@ template <class T, class Enable = void>
struct tester;
template <class T>
struct tester<T, typename enable_if<is_arithmetic<T>::value>::type> {
struct tester<T, typename enable_if_c<is_arithmetic<T>::value>::type> {
BOOST_STATIC_CONSTANT(bool, value = true);
};
template <class T>
struct tester<T, typename disable_if<is_arithmetic<T>::value>::type> {
struct tester<T, typename disable_if_c<is_arithmetic<T>::value>::type> {
BOOST_STATIC_CONSTANT(bool, value = false);
};
template <class T, class Enable = void>
struct tester2;
template <class T>
struct tester2<T, typename enable_if<is_arithmetic<T> >::type> {
BOOST_STATIC_CONSTANT(bool, value = true);
};
template <class T>
struct tester2<T, typename disable_if<is_arithmetic<T> >::type> {
BOOST_STATIC_CONSTANT(bool, value = false);
};
@@ -40,6 +55,12 @@ int test_main(int, char*[])
BOOST_TEST(!tester<char*>::value);
BOOST_TEST(!tester<void*>::value);
BOOST_TEST(tester2<int>::value);
BOOST_TEST(tester2<double>::value);
BOOST_TEST(!tester2<char*>::value);
BOOST_TEST(!tester2<void*>::value);
return 0;
}