Boost logo

Boost :

Subject: Re: [boost] "peer reviewed" - Rights and responsibilities of maintainers
From: Steven Watanabe (watanabesj_at_[hidden])
Date: 2018-10-17 01:10:37


On 10/16/2018 06:54 PM, Gavin Lambert via Boost wrote:
> <snip>
> Technically it's UB to access a global bool after "destruction" (just
> like any other object) and it could possibly be "destroyed" before the
> singleton due to unspecified global destruction order.

That's not correct. If an object has static storage duration
and a trivial destructor, then it is never "destroyed."
Its storage exists "for the lifetime of the program" []
and its lifetime ends when "the storage which the object
occupies is reused or released" []

> Though you're correct that since bool has a trivial destructor it is
> *usually* not actually a problem in practice.  (AFAIK a compiler is
> within its rights to zero or otherwise stomp the memory after
> "destruction", though most probably wouldn't bother, except perhaps as a
> diagnostic/sanitiser.)
> It's still a sign of a fundamental lifetime mismatch somewhere, though.
In Christ,
Steven Watanabe

Boost list run by bdawes at, gregod at, cpdaniel at, john at