Re: [PATCH] libstdc++: Define std::__is_constant_evaluated() for internal use

2021-11-26 Thread Jakub Jelinek via Gcc-patches
On Fri, Nov 26, 2021 at 12:43:44PM +, Jonathan Wakely wrote: > > On Fri, Nov 26, 2021 at 12:29:25PM +, Jonathan Wakely via Gcc-patches > > wrote: > > > + // Internal version of std::is_constant_evaluated() for C++11. > > > + // This can be used without checking if the compiler supports t

Re: [PATCH] libstdc++: Define std::__is_constant_evaluated() for internal use

2021-11-26 Thread Jonathan Wakely via Gcc-patches
On Fri, 26 Nov 2021 at 12:39, Jakub Jelinek wrote: > > On Fri, Nov 26, 2021 at 12:29:25PM +, Jonathan Wakely via Gcc-patches > wrote: > > + // Internal version of std::is_constant_evaluated() for C++11. > > + // This can be used without checking if the compiler supports the > > built-in. >

Re: [PATCH] libstdc++: Define std::__is_constant_evaluated() for internal use

2021-11-26 Thread Jakub Jelinek via Gcc-patches
On Fri, Nov 26, 2021 at 12:29:25PM +, Jonathan Wakely via Gcc-patches wrote: > + // Internal version of std::is_constant_evaluated() for C++11. > + // This can be used without checking if the compiler supports the built-in. > + constexpr inline bool > + __is_constant_evaluated() noexcept >

Re: [PATCH] libstdc++: Define std::__is_constant_evaluated() for internal use

2021-11-26 Thread Ville Voutilainen via Gcc-patches
On Fri, 26 Nov 2021 at 14:29, Jonathan Wakely via Libstdc++ wrote: > > I've bored of having to do preprocessor checks before using > is_constant_evaluated, so I've come up with this approach. Anybody got a > better idea, or objections to this? None here, I like this improvement.

[PATCH] libstdc++: Define std::__is_constant_evaluated() for internal use

2021-11-26 Thread Jonathan Wakely via Gcc-patches
I've bored of having to do preprocessor checks before using is_constant_evaluated, so I've come up with this approach. Anybody got a better idea, or objections to this? An alternative to __is_constant_evaluated would be to define a function called __builtin_is_constant_evaluated when it isn't supp