3 ms·
Could you not put a series of steps or something that mocks time into constexpr? A comment mentioned above that in C++20, almost all features are available at c
by mr_00ff00 4y ago
Could you not put a series of steps or something that mocks time into constexpr? A comment mentioned above that in C++20, almost all features are available at compile time now.
- ovao 4y agoWith few limitations, yes. In C++20, you could for example test for constant evaluation[1], using that as a mechanism to fall back to a real clock during runtime. [1]: https://en.cppreference.com/w/cpp/types/is_constant_evaluated https://en.cppreference.com/w/cpp/types/is_constant_evaluate...