We have constexpr
functions since C++11, and they have been getting less restricted since with every new standard (14, 1z).
Yet, the most obvious functions in STL which could be made constexpr
, the cmath
/math.h
functions, still have no constexpr
version in any standard library implementation AFAIK.
Is this just in the backlog of the C++ standard, or is there any other reason why we still don't have constexpr
versions of these functions?
math
tag is appropriate here, at least according to the tag wiki. I suggest you remove it. – tambre Feb 12 '17 at 15:09sin
cos
,... asconstexpr
, and while it was not impossible it did pose a big challenge at least using c++11. A big part of the issue is that it would be hard to guarantee that the algorithms that they could use to generate aconstexpr
version of the functions would be of the same quality as the runtime versions. And that doesn't even account for the need for error handling... – Alex Zywicki Feb 12 '17 at 15:48constexpr
versions of<cmath>
functions equally is a matter of fact, not opinion. Please do not close questions about the ISO standardization process if you personally aren't familiar with it. – MSalters Feb 12 '17 at 22:25