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
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.
>
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
>
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.
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