C++ Logo

std-discussion

Advanced search

Re: Lifetime of references

From: language.lawyer_at <language.lawyer_at_[hidden]>
Date: Sat, 12 Oct 2019 00:26:01 +0300
I know only 2 cases when a program could use an uninitialized reference:
1) During initialization of a non-local variable
2) During initialization of a data member

In all other cases I think the wording can be rewritten in a way it does not rely on the concept of reference lifetime.

An object could be "bad" only if it is outside of its lifetime (and the period of construction/destruction),
but a reference could be "bad" for 2 reasons: it is outside its lifetime or it is "dangled".


On 11/10/2019 19:38, Krystian Stasiowski via Std-Discussion wrote:
> I think it's more of a formality so we can apply [basic.life] p4 to it.
> null
>
>

Received on 2019-10-11 16:28:16