3 ms·
My understanding is that all of the functions found in the C compatibility headers that the C++ standard defines can not be made constexpr. sqrt is among them,
by Maxatar 2y ago
My understanding is that all of the functions found in the C compatibility headers that the C++ standard defines can not be made constexpr. sqrt is among them, as are a lot of the math functions.
- agosz 2y agoThe compatibility can be solved with macros to toggle it on or off depending on how you're building. C++26 has constexpr sqrt.
- pjmlp 2y agoThere is a paper suggesting to replace all macro based code, due to way modules work. https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2025/p2654r1.pdf https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2025/p26...