Show HN: C++ runtime/compile-time detection in constexpr functions
1–10 of 22 posts
Re: Show HN: C++ runtime/compile-time detection in constexpr functions
#2http://saadahmad.ca/detecting-evaluation-context-inside-cons...
Re: Show HN: C++ runtime/compile-time detection in constexpr functions
#3Re: Show HN: C++ runtime/compile-time detection in constexpr functions
#4In README: "[...] we can choose to implement a runtime specific algorithm while having a different algorithm for doing something at runtime." Typo?
Re: Show HN: C++ runtime/compile-time detection in constexpr functions
#5I discuss the approach more in depth here: http://saadahmad.ca/detecting-evaluation-context-inside-cons...
Re: Show HN: C++ runtime/compile-time detection in constexpr functions
#6Re: Show HN: C++ runtime/compile-time detection in constexpr functions
#7If 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.
Re: Show HN: C++ runtime/compile-time detection in constexpr functions
#8Just 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…
Re: Show HN: C++ runtime/compile-time detection in constexpr functions
#9Re: Show HN: C++ runtime/compile-time detection in constexpr functions
#10Stuff like this shows that we need to introduce even more things into C++. I am not kidding. There are still many things to improve in C++.