00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00026
00027 #ifndef QOLYESTER_UTL_META_HH
00028 # define QOLYESTER_UTL_META_HH 1
00029
00030 # include <ostream>
00031
00032 namespace olsr {
00033
00034 namespace utl {
00035
00036 class NullType {};
00037
00038 namespace internal {
00039
00040
00041
00042
00043
00044 template <bool assertion> struct static_assert {};
00045 template <> struct static_assert<true> {
00046 static inline void icheck() {}
00047 static const int dcheck = 1;
00048 };
00049
00050
00051 template <typename T1, typename T2> struct same_type {};
00052 template <typename T> struct same_type<T, T> {
00053 static void icheck() {}
00054 static const int dcheck = 1;
00055 };
00056
00057 }
00058
00059
00064 # define i_static_assert(Assertion...) utl::internal::static_assert<(Assertion)>::icheck()
00065
00070 # define d_static_assert(Assertion...) utl::internal::static_assert<(Assertion)>::dcheck
00071
00076 # define i_same_type(Type1, Type2) utl::internal::same_type<Type1, Type2 >::icheck()
00077
00082 # define d_same_type(Type1, Type2) utl::internal::same_type<Type1, Type2 >::dcheck
00083
00084 inline
00085 std::ostream& operator<<(std::ostream&, const NullType&);
00086
00087 }
00088
00089 typedef utl::NullType null_t;
00090
00091 }
00092
00093 # include "meta.hxx"
00094
00095 #endif // ! QOLYESTER_UTL_META_HH