2.2 KiB
[basic.stc.general]
6 Basics [basic]
6.8 Memory and objects [basic.memobj]
6.8.6 Storage duration [basic.stc]
6.8.6.1 General [basic.stc.general]
The storage duration is the property of an object that defines the minimum potential lifetime of the storage containing the object.
The storage duration is determined by the construct used to create the object and is one of the following:
static storage duration
thread storage duration
automatic storage duration
dynamic storage duration
[Note 1:
After the duration of a region of storage has ended, the use of pointers to that region of storage is limited ([basic.compound]).
â end note]
Static, thread, and automatic storage durations are associated with objects introduced by declarations ([basic.def]) and with temporary objects ([class.temporary]).
The dynamic storage duration is associated with objects created by anew-expression ([expr.new]) or with implicitly created objects ([intro.object]).
The storage duration categories apply to references as well.
The storage duration of subobjects and reference members is that of their complete object ([intro.object]).