Re:BOOST_STATIC_ASSERT(false) - was (no subject)

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)
This *should* work. IMHO, if it doesn't, we should fix it, not work around it like Michiel suggested.
However, its doesn't work with compilers that are too smart for their own good. In order to make
I don't think I'ts fixable. But maybe one might want to make another macro named something like BOOST_BETTER_NOT_ARRIVE_HERE - lol this
work I need something like:
Which compiler and which version of boost and the Compiler are you using? Can you provide a minimal but complete example? Also, you might want to have a look at checked_delete where we had similar problems in the past IIRC.
I've noticed it at least on Comeau. I just used the fix above so now I don't see it. So now I don't know which compilers complain. Robert Ramey

On Thu, 24 Jun 2004 13:36:07 -0700, "Robert Ramey" <ramey@rrsd.com> 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.
participants (2)
-
Gennaro Prota
-
Robert Ramey