aboutsummaryrefslogtreecommitdiffhomepage
path: root/test/meta.cpp
diff options
context:
space:
mode:
authorGravatar Hauke Heibel <hauke.heibel@gmail.com>2010-10-25 22:13:49 +0200
committerGravatar Hauke Heibel <hauke.heibel@gmail.com>2010-10-25 22:13:49 +0200
commit7bc8e3ac0917cdc14015e00e8b29ac299b2b772a (patch)
tree8c6af03e1d27e0e035bc4bd9be042f78384d10e1 /test/meta.cpp
parent597b2745e1cfe1bf1cc4c4c189ecd16d2a0c1738 (diff)
Initial fixes for bug #85.
Renamed meta_{true|false} to {true|false}_type, meta_if to conditional, is_same_type to is_same, un{ref|pointer|const} to remove_{reference|pointer|const} and makeconst to add_const. Changed boolean type 'ret' member to 'value'. Changed 'ret' members refering to types to 'type'. Adapted all code occurences.
Diffstat (limited to 'test/meta.cpp')
-rw-r--r--test/meta.cpp42
1 files changed, 21 insertions, 21 deletions
diff --git a/test/meta.cpp b/test/meta.cpp
index ba2167677..fb7d4548c 100644
--- a/test/meta.cpp
+++ b/test/meta.cpp
@@ -29,30 +29,30 @@ void test_meta()
typedef float & FloatRef;
typedef const float & ConstFloatRef;
- VERIFY((internal::meta_if<(3<4),internal::meta_true, internal::meta_false>::ret::ret));
- VERIFY(( internal::is_same_type<float,float>::ret));
- VERIFY((!internal::is_same_type<float,double>::ret));
- VERIFY((!internal::is_same_type<float,float&>::ret));
- VERIFY((!internal::is_same_type<float,const float&>::ret));
+ VERIFY((internal::conditional<(3<4),internal::true_type, internal::false_type>::type::value));
+ VERIFY(( internal::is_same<float,float>::value));
+ VERIFY((!internal::is_same<float,double>::value));
+ VERIFY((!internal::is_same<float,float&>::value));
+ VERIFY((!internal::is_same<float,const float&>::value));
- VERIFY(( internal::is_same_type<float,internal::cleantype<const float&>::type >::ret));
- VERIFY(( internal::is_same_type<float,internal::cleantype<const float*>::type >::ret));
- VERIFY(( internal::is_same_type<float,internal::cleantype<const float*&>::type >::ret));
- VERIFY(( internal::is_same_type<float,internal::cleantype<float**>::type >::ret));
- VERIFY(( internal::is_same_type<float,internal::cleantype<float**&>::type >::ret));
- VERIFY(( internal::is_same_type<float,internal::cleantype<float* const *&>::type >::ret));
- VERIFY(( internal::is_same_type<float,internal::cleantype<float* const>::type >::ret));
+ VERIFY(( internal::is_same<float,internal::cleantype<const float&>::type >::value));
+ VERIFY(( internal::is_same<float,internal::cleantype<const float*>::type >::value));
+ VERIFY(( internal::is_same<float,internal::cleantype<const float*&>::type >::value));
+ VERIFY(( internal::is_same<float,internal::cleantype<float**>::type >::value));
+ VERIFY(( internal::is_same<float,internal::cleantype<float**&>::type >::value));
+ VERIFY(( internal::is_same<float,internal::cleantype<float* const *&>::type >::value));
+ VERIFY(( internal::is_same<float,internal::cleantype<float* const>::type >::value));
- VERIFY(( internal::is_same_type<float*,internal::unconst<const float*>::type >::ret));
- VERIFY(( internal::is_same_type<float&,internal::unconst<const float&>::type >::ret));
- VERIFY(( internal::is_same_type<float&,internal::unconst<ConstFloatRef>::type >::ret));
+ VERIFY(( internal::is_same<float*,internal::remove_const<const float*>::type >::value));
+ VERIFY(( internal::is_same<float&,internal::remove_const<const float&>::type >::value));
+ VERIFY(( internal::is_same<float&,internal::remove_const<ConstFloatRef>::type >::value));
- VERIFY(( internal::is_same_type<float&,internal::unconst<float&>::type >::ret));
- VERIFY(( internal::is_same_type<float,internal::unref<float&>::type >::ret));
- VERIFY(( internal::is_same_type<const float,internal::unref<const float&>::type >::ret));
- VERIFY(( internal::is_same_type<float,internal::unpointer<float*>::type >::ret));
- VERIFY(( internal::is_same_type<const float,internal::unpointer<const float*>::type >::ret));
- VERIFY(( internal::is_same_type<float,internal::unpointer<float* const >::type >::ret));
+ VERIFY(( internal::is_same<float&,internal::remove_const<float&>::type >::value));
+ VERIFY(( internal::is_same<float,internal::remove_reference<float&>::type >::value));
+ VERIFY(( internal::is_same<const float,internal::remove_reference<const float&>::type >::value));
+ VERIFY(( internal::is_same<float,internal::remove_pointer<float*>::type >::value));
+ VERIFY(( internal::is_same<const float,internal::remove_pointer<const float*>::type >::value));
+ VERIFY(( internal::is_same<float,internal::remove_pointer<float* const >::type >::value));
VERIFY(internal::meta_sqrt<1>::ret == 1);
#define VERIFY_META_SQRT(X) VERIFY(internal::meta_sqrt<X>::ret == int(internal::sqrt(double(X))))