Y
HN Search
Hacker News Search
new
|
comments
|
top
|
jobs
tcbrindle
searching Neon…
1.
▲
2.
▲
3.
▲
4.
▲
5.
▲
6.
▲
4 ms
·
1.
▲
by
tcbrindle
2y ago
> memory_order::relaxed < cv_status::timeout is true No it isn't. https://godbolt.org/z/bz7EhMhMT
2.
▲
by
tcbrindle
8y ago
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 mymo
3.
▲
by
tcbrindle
8y ago
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 interpreting constexpr
4.
▲
by
tcbrindle
8y ago
> 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 by transl
5.
▲
by
tcbrindle
8y ago
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 and loops were allowed,
6.
▲
by
tcbrindle
8y ago
6. A constexpr function is guaranteed to have no undefined behaviour (when evaluated at compile time, anyway)
7.
▲
by
tcbrindle
8y ago
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 this?") :)
8.
▲
by
tcbrindle
11y ago
I admit I clicked this thinking it was going to be about junk food.