Lifetime of object is over before destructor is called?

前端 未结 4 752
广开言路
广开言路 2020-12-03 11:38

I don\'t understand this:

3.8/1 \"The lifetime of an object of type T ends when: — if T is a class type with a non-trivial destructor (12.4), the

4条回答
  •  南方客
    南方客 (楼主)
    2020-12-03 12:17

    The "lifetime" of an object is relevant for consumers of the object, not the object itself. Therefore a consuming class should not attempt to access members of an object once destruction has started.

提交回复
热议问题