Future support of constexpr math functions

Timothy Wrona tjwrona1992@gmail.com
Fri Feb 14 01:26:00 GMT 2020


Hi,

I am writing some code that relies heavily on the use of constexpr math
functions to do calculations at compile time. The ability to do these
calculations at compile time is essential for the performance of the
library.

Currently gcc is the only compiler that supports compile time math
operations such as "constexpr sin" and "constexpr cos". And it seems that
by doing so gcc is technically not conforming to the standard.

See here:
https://stackoverflow.com/questions/27744079/is-it-a-conforming-compiler-extension-to-treat-non-constexpr-standard-library-fu


I am concerned that if I go down this path and become dependent on these
non-conforming features, support for this functionality may be dropped in a
future release of gcc. Is there any way I can get more information on plans
for future support of constexpr math functions in gcc?

Thanks,
Tim



More information about the Gcc-help mailing list