Fwd: How do I conditionally define a function as constexpr depending on another function?

Anadon joshua.r.marshall.1991@gmail.com
Sat Nov 12 02:35:33 GMT 2022


I have a piece of code which only compiles on g++-12.  This is related to
said code being constexpr and std::forward_list letting that work on g++-12
but not any other compiler or older version.  I would like a way to define
these functions as constexpr when possible and otherwise not be defined as
constexpr for compatability and standards conformance.  I'm sure I'm just
looking in the wrong places or with the wrong words.

For reference, code is here:
https://gitlab.com/anadon/prime_generator_header


More information about the Libc-help mailing list