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
"Lifetime" doesn't mean that. It is a precisely defined term in the standard that has a variety of implications, but it might not have all the implications that you would think. Members can still be used during construction and destruction, outside code can call member functions, etc, etc.
Granted, it's a bit odd for client code to call member functions concurrently with the destructor, but not unheard of and certainly not disallowed by the language. In particular, std::condition_variable
explicitly allows the destructor to be invoked while there are outstanding calls to condition_variable::wait()
. It only prohibits new calls to wait()
after the destructor starts.