This syntax was used as a part of an answer to this question:
template
struct static_assert;
template <>
struct static_assert
STATIC_ASSERT(true);
indeed means
static_assert();
which evaluates to nothing. static_assert
is just an empty structure without any members. static_assert
creates an object of that structure and does not store it anywhere.
This simply compiles and does nothing.
On the other hand
STATIC_ASSERT(false);
means
static_assert();
which results in compilation error. static_assert
has no specialization for false
. So a general form is used. But the general form is given as follows:
template
struct static_assert;
which is just a declaration of a structure and not its definition. So static_assert
causes compilation error as it tries to make an object of a structure which is not defined.