Boost logo

Boost :

Subject: Re: [boost] [system] Would it be possible to trial a breaking change to Boost.System and see what happens?
From: Peter Dimov (lists_at_[hidden])
Date: 2018-01-14 01:34:00


Niall Douglas wrote:

> How do you guarantee that only one instance of an error category will ever
> exist in the process?
>
> If it's allowable to constexpr, I don't see how that's possible. I'd love
> to be corrected due to ignorance.

constexpr in this case doesn't change the number of instances that can exist
in the process. The way to guarantee a single instance is to use the DLL/so
runtime, and put the instance there.

> MSVC's Immortalize is a directive to the VC runtime to ensure a single
> instance ever.

MS's _Immortalize is there to guarantee that the system_error machinery can
be used during and after static destruction. That's why it's called
"immortalize" - it makes the instance immortal, that is, makes sure its
destructor is never invoked.


Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk