> memory_order::relaxed < cv_status::timeout is true No it isn't. https://godbolt.org/z/bz7EhMhMT
Except that, as mentioned in TFA, as currently proposed it's possible to say #if SOME_PREPROCESSOR_JUNK import foo; #else import bar; #endif This has legitimate use cases, say #ifdef WIN32 import mymodule.windows #else…
The presence of template specialisations and constexpr functions means that the GP is right here; you cannot decide whether an arbitrary piece of C++ is syntactically valid without instantiating templates and/or…
> Why on earth would you do this? Good question! :) It actually started out as a learning exercise -- I didn't (and still don't) know much about ray tracing, and so I thought it would be good to study a simple example…
While constexpr was introduced in C++11, it was initially very limited -- a constexpr function could only consist of a single return statement, for example. It was only in C++14 that things like variable declarations…
6. A constexpr function is guaranteed to have no undefined behaviour (when evaluated at compile time, anyway)
Author here. I wrote this on a rainy weekend last year and mostly forgot about it, so it was a bit of a surprise to see it pop up on HN this morning! Happy to answer any questions (including "why on earth would you do…
I admit I clicked this thinking it was going to be about junk food.
> memory_order::relaxed < cv_status::timeout is true No it isn't. https://godbolt.org/z/bz7EhMhMT
Except that, as mentioned in TFA, as currently proposed it's possible to say #if SOME_PREPROCESSOR_JUNK import foo; #else import bar; #endif This has legitimate use cases, say #ifdef WIN32 import mymodule.windows #else…
The presence of template specialisations and constexpr functions means that the GP is right here; you cannot decide whether an arbitrary piece of C++ is syntactically valid without instantiating templates and/or…
> Why on earth would you do this? Good question! :) It actually started out as a learning exercise -- I didn't (and still don't) know much about ray tracing, and so I thought it would be good to study a simple example…
While constexpr was introduced in C++11, it was initially very limited -- a constexpr function could only consist of a single return statement, for example. It was only in C++14 that things like variable declarations…
6. A constexpr function is guaranteed to have no undefined behaviour (when evaluated at compile time, anyway)
Author here. I wrote this on a rainy weekend last year and mostly forgot about it, so it was a bit of a surprise to see it pop up on HN this morning! Happy to answer any questions (including "why on earth would you do…
I admit I clicked this thinking it was going to be about junk food.