lmi
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [lmi] constexpr conversion functions


From: Vadim Zeitlin
Subject: Re: [lmi] constexpr conversion functions
Date: Mon, 1 Aug 2022 20:29:38 +0200

On Mon, 1 Aug 2022 16:54:26 +0000 Greg Chicares <gchicares@sbcglobal.net> wrote:

GC> On 8/1/22 15:59, Vadim Zeitlin wrote:
GC> > On Mon, 1 Aug 2022 15:31:25 +0000 Greg Chicares <gchicares@sbcglobal.net> 
wrote:
GC> [...]
GC> > GC> Let me put that question in a different way: if I were to report this 
as
GC> > GC> a defect,
GC> > 
GC> >  Sorry, but what exactly would you report as a defect? Surely a compiler
GC> > can't possibly propose adding a constexpr to a function without a
GC> > definition and what else could/would you expect? I feel like I'm missing a
GC> > step here, sorry in advance if I just overlooked something, but could you
GC> > please explain again what do you think the defect is?
GC> 
GC> I had thought that they should require 'constexpr' on struct ambiguator's
GC> conversion-operator declarations.

 Ah, I see, sorry for missing it.

GC> However, when I tried to marshal a case for such a requirement, I was
GC> unable to convince myself that the language requires 'constexpr' there.

 I think they key here is that this function (i.e. the conversion operator)
is only used in unevaluated context. If it were actually evaluated, then it
would have needed to be constexpr, of course.

VZ

Attachment: pgpjmdG7cP9F0.pgp
Description: PGP signature


reply via email to

[Prev in Thread] Current Thread [Next in Thread]