|
|
|
|
|
by kazinator
2612 days ago
|
|
> but the C++ type system gives you no way to create an object with lifetimes that don't correspond to some scope. Counterexample: a data member of a class has a lifetime tied to the lifetime of the containing object instance, rather than to a lexical scope. |
|
Phrased another way, I'm just saying that the C++ type system only expresses two types of storage durations: those tied to lexical scopes and dynamic storage durations, and provides no checks for dynamic storage durations.