N
nevergone
Hello Everybody
In <<Modern C++ Design>> Compile-Time Assertions
there is :
template <bool> struct CompileTimeChecker
{
CompileTimeChecker(...);
};
template <> struct CompileTimeChecker<false> { };
#define STATIC_CHECK(expr,msg) \
{ \
class ERROR_##msg {}; \
(void)sizeof( CompileTimeChecker< (expr) !=
0>( (ERROR_##msg() ) )); \
}
//.....
so my question is why " (void)sizeof( CompileTimeChecker< (expr) !=
0>( (ERROR_##msg() ) )); \" must add sizeof?
Thanks
In <<Modern C++ Design>> Compile-Time Assertions
there is :
template <bool> struct CompileTimeChecker
{
CompileTimeChecker(...);
};
template <> struct CompileTimeChecker<false> { };
#define STATIC_CHECK(expr,msg) \
{ \
class ERROR_##msg {}; \
(void)sizeof( CompileTimeChecker< (expr) !=
0>( (ERROR_##msg() ) )); \
}
//.....
so my question is why " (void)sizeof( CompileTimeChecker< (expr) !=
0>( (ERROR_##msg() ) )); \" must add sizeof?
Thanks