[Bug c++/39462] check assert() at compile time if possible
ich at az2000 dot de
gcc-bugzilla@gcc.gnu.org
Sun Mar 15 00:10:00 GMT 2009
------- Comment #5 from ich at az2000 dot de 2009-03-15 00:10 -------
(In reply to comment #4)
> Also - I admit not having studied in detail all your requirements, sorry about
> that - I suppose you would be interested in static_assert, available with
> -std=c++0x, in gcc4.3.x (and 4.4.x, of course):
>
> http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2004/n1720.html
>
Thanks, but static_assert is not an option. It would make things only more
complicated and can not cover a lot of cases.
I also don't really understand why there is something like a static_assert (I
am not sure how much I really would use an assert outside of a function). If a
compiler would be intelligent enough to check asserts at compile time if
possible, to differ between static_assert and assert only makes it more
complicated - mostly for the programmer.
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=39462
More information about the Gcc-bugs
mailing list