C++ Logo

std-discussion

Advanced search

Re: Wording Includes Normal Use Case

From: Brian Bi <bbi5291_at_[hidden]>
Date: Thu, 23 Nov 2023 22:31:58 -0500
On Thu, Nov 23, 2023 at 4:25 PM Jens Maurer <jens.maurer_at_[hidden]> wrote:

>
>
> On 23/11/2023 21.50, Brian Bi wrote:
> >
> >
> > On Thu, Nov 23, 2023 at 2:43 PM Jens Maurer via Std-Discussion <
> std-discussion_at_[hidden] <mailto:std-discussion_at_[hidden]>>
> wrote:
> >
> >
> > On 23/11/2023 19.42, Daniel Markus via Std-Discussion wrote:
> > > Maybe I'm picky and probably everyone understands what is meant,
> but
> > > what's said right now is that the (an) other object occupies its
> own
> > > storage location, which is the normal use case.
> >
> > There is half a sentence in front that talks about ending the
> lifetime
> > prior to the implicit destructor call, and there is an example that
> follows.
> >
> > What exactly is unclear here?
> >
> >
> > I think the issue is that the normative wording is not clear about the
> temporal relationship, i.e., that the UB only occurs if the ending of the
> lifetime (without subsequent recreation of an object of the same time)
> happens /before/ the implicit destructor call---as opposed to when you do
> nothing and just let the implicit destructor call take place (in which case
> the ending of the lifetime occurs at the same time as the implicit
> destructor call, because the start of the implicit destructor call ends the
> lifetime).
>
> Aha. Maybe we want to make this a note and rely on [stmt.dcl] p2
> and [basic.life] p7.2 instead?
>

Yeah, I agree that it should be a note. In terms of references, it seems
like you'd have to throw in [basic.start.term] p1 and p2 as well.


>
> Jens
>


-- 
*Brian Bi*

Received on 2023-11-24 03:32:12