C++ Logo

STD-DISCUSSION

Advanced search

Subject: Re: How do I know whether a call to a constexpr standard library function is actually a constant expression?
From: Thiago Macieira (thiago_at_[hidden])
Date: 2019-11-15 15:53:23


On sexta-feira, 15 de novembro de 2019 13:00:44 PST Brian Bi wrote:
> > What do you mean by "constexpr context"?

constexpr or constinit variable initialisation, template parameters, size of
arrays (aside from Variable Length Arrays), etc.

> > Why does it matter?
>
> It matters because it determines whether:
>
> constexpr auto x = some_constexpr_library_function(some_args)
>
> actually compiles.

If the standard says the function is constexpr, some_args are constant
expression too, then it compiles.

-- 
Thiago Macieira - thiago (AT) macieira.info - thiago (AT) kde.org
   Software Architect - Intel System Software Products

STD-DISCUSSION list run by std-discussion-owner@lists.isocpp.org

Older Archives on Google Groups