6
Basics
[basic]
6.7
Memory and objects
[basic.memobj]
6.7.5
Storage duration
[basic.stc]
6.7.5.1
General
[basic.stc.general]
1
#
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:
(1.1)
static storage duration
(1.2)
thread storage duration
(1.3)
automatic storage duration
(1.4)
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
]
2
#
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 a
new-expression
(
[expr.
new]
) or with implicitly created objects (
[intro.
object]
)
.
3
#
The storage duration categories apply to references as well
.
4
#
The storage duration of subobjects and reference members is that of their complete object (
[intro.
object]
)
.