Hacker News new | ask | show | jobs
by lbrandy 3232 days ago
Just so I'm clear, what this appears to be doing is the moral equivalent of a function that asks if some constant equals what we know to be its value (true at compile time)? And then at program-init time (via __attribute__((constructor(101)))) changing the value of the constant in the text section so the test is now false?

If so, that's both quite clever and something I don't think I want in my codebase :P. The good news is I'm pretty sure Daveed's proposal that you mention (http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2017/p059...) got support last time it came around EWG so I'm hoping we can just go that way.

1 comments

Yes that's exactly what's happening under the hood. I'm definitely looking forward to the constexpr operator being accepted!