
Thorsten Ottosen wrote:
Hi All,
I'm about to replace all my throw Foo; statetements in the Pointer Container library with something else to support platforms without exceptions.
Is using boost::throw_exception the way to do it?
If I where on such a platform, I kinda think that I would have preferred an assertion *at the throw spot* instead of making the call stack deeper yet and then call about or something.
If it is not a throw expression it ought to be something with similar semantics, such as a function with __attribute__((__noreturn__)) (or whatever it is spelled for a particular compiler), so the compiler knows that no code past this point is ever executed. Else you may get spurious warnings about missing return statements. In fact, I'd suggest that boost::throw_exception() be tagged by such an attribute (on platform that support it). Regards, Stefan