Boost logo

Boost :

From: Gennaro Prota (gennaro_prota_at_[hidden])
Date: 2004-06-27 03:23:01


On Thu, 24 Jun 2004 13:36:07 -0700, "Robert Ramey" <ramey_at_[hidden]>
wrote:

>I hadn't considered Michaels idea. I've been using BOOST_STATIC_ASSERT(0 ==
>sizeof(T)).
>
>
>Michiel Salters wrote:
>
>>Robert Ramey wrote:
>>> BOOST_STATIC_ASSERT(false)

Sorry if I'm missing the context of discussion but the only message of
this thread that I see is the one I'm directly replying to.

If BOOST_STATIC_ASSERT(false) is in a template function or class then
you have a template for which no valid specialization can be
generated. In that case the program is ill-formed and no diagnostic is
required unless the template is instantiated. As a QoI issue many
implementations diagnose simple cases (at the point of definition),
but the general case is of course equivalent to the halt problem. In
practice it's enough to change "false" to something complex enough and
the compiler will not emit diagnostics until the template is actually
instantiated. I don't have the standard handy now but the rule must be
in clause 14 in the section about name resolution.

--
Genny.

Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk