Related to #189.
<cmath>
is one of the STL's most complicated headers (despite the seeming simplicity) because of the "sufficient additional overloads" Standardese in WG21-N4861 [cmath.syn]/2. There's a system of overloads for float
and long double
(in addition to double
provided by the UCRT), and then templates to handle mixed/integral arguments.
There's also some variation - fma
and remquo
, added in C++11, use a newer technique powered by if constexpr
:
(I suspect that
float, float
arguments are always handled by the separate overload, so there is currently no way to activate it for the template.)
Due to [namespace.std]/6 forbidding forming pointers/references to Standard Library functions (except for "addressable functions"), I believe it may now be unobservable whether the float
and long double
overloads exist separately. If that's the case, now that if constexpr
is available for unconditional use, we should consider eliminating the separate overloads and centralizing everything in remquo
-style templates.
Again, due to the complexity, changing anything here is relatively high-risk, but it's not impossible.
RetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4