Go to the documentation of this file.00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00016
00017
00018
00019 template<bool ERROR___INCORRECT_OR_UNSUPPORTED_TYPE>
00020 struct arma_type_check_cxx1998
00021 {
00022 arma_inline
00023 static
00024 void
00025 apply()
00026 {
00027 static const char
00028 junk[ ERROR___INCORRECT_OR_UNSUPPORTED_TYPE ? -1 : +1 ];
00029 }
00030 };
00031
00032
00033
00034 template<>
00035 struct arma_type_check_cxx1998<false>
00036 {
00037 arma_inline
00038 static
00039 void
00040 apply()
00041 {
00042 }
00043 };
00044
00045
00046
00047 #if !defined(ARMA_USE_CXX11)
00048
00049 #define arma_static_check(condition, message) static const char message[ (condition) ? -1 : +1 ]
00050
00051 #define arma_type_check(condition) arma_type_check_cxx1998<condition>::apply()
00052
00053 #else
00054
00055 #define arma_static_check(condition, message) static_assert( !(condition), #message )
00056
00057 #define arma_type_check(condition) static_assert( !(condition), "error: incorrect or unsupported type" )
00058
00059 #endif
00060
00061
00062