Re:Wordlexpr: Compile-Time Wordle in C++20
by nneonneo on Monday February 28, 2022 @04:20AM
(#30497958)
Neat hack! One minor improvement suggestion: if you seed the RNG with `__DATE__` (or a hash of that string), then you can replicate the one-puzzle-a-day experience with no need for an externally-supplied seed variable.
Re:Wordlexpr: Compile-Time Wordle in C++20
by jcelerier on Monday February 28, 2022 @05:59AM
(#30498548)
A very neat thing of constexpr is that it does not have undefined behaviour ; any thing that would cause UB at run-time is flagged as a compile error. Every variable must be fully initialized.
Re:Wordlexpr: Compile-Time Wordle in C++20
by xroche on Monday February 28, 2022 @04:54AM
(#30498178)
You simply can't. The constexpr environment won't let you have uninitialized variables/memory anywhere. It won't let you access dangling/out-of-bounds pointers either, overflow two-complement types, etc.
C++20 Oxymoron: Constexpr Virtual:
https://news.ycombinator.com/item?id=28509579