Go to the documentation of this file.00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015 #ifndef GDCMSTATICASSERT_H
00016 #define GDCMSTATICASSERT_H
00017
00018
00019
00020 namespace gdcm
00021 {
00022 template <bool x>
00023 struct STATIC_ASSERTION_FAILURE;
00024
00025 template <>
00026 struct STATIC_ASSERTION_FAILURE<true> { enum { value = 1 }; };
00027
00028 template <int x>
00029 struct static_assert_test {};
00030 }
00031
00032 #define GDCM_JOIN( X, Y ) GDCM_DO_JOIN( X, Y )
00033 #define GDCM_DO_JOIN( X, Y ) GDCM_DO_JOIN2(X,Y)
00034 #define GDCM_DO_JOIN2( X, Y ) X##Y
00035
00037 #define GDCM_STATIC_ASSERT( B ) \
00038 typedef ::gdcm::static_assert_test<\
00039 sizeof(::gdcm::STATIC_ASSERTION_FAILURE< (bool)( B ) >)>\
00040 GDCM_JOIN(gdcm_static_assert_typedef_, __LINE__)
00041
00042
00043
00044
00045
00046
00047
00048
00049
00050
00051
00052
00053 #endif // GDCMSTATICASSERT_H
00054