
19 Sep
2004
19 Sep
'04
5:15 a.m.
"Robert Ramey" <ramey@rrsd.com> wrote in message news:20040919040443.D18A931132@acme.west.net...
"David B. Held" <dheld@codelogicconsulting.com> wrote in message news:cihmvu$3ik$1@sea.gmane.org...
#include <boost/static_assert.hpp>
template <typename T> struct foo { void bar(void) { BOOST_STATIC_ASSERT(false); } };
I use
.... BOOST_STATIC_ASSERT(sizeof(T) == 0);
The expression 'always_false<T>::value' can't be evaluated until the point of instantiation, since always_false could be specialized for T. OTOH, the compiler can tell immediately that 'sizeof(T) == 0' is false, so might it not replace 'sizeof(T) == 0' with 'false', and then issue the same error as in the quoted case? Jonathan