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-13 15:20:19


> Andrey Semashev wrote:
>
> > I don't think the standard requires this implementation.
> > `system_category()` may return a pointer to a global caregory instance,
> > which is initialized before `main`.
>
> You're not prohibited from calling system_category() before main, so it
> has to work.

You can see for yourself what happens in practice today:
https://godbolt.org/g/1TfPQw

The g++/clang++ generated code looks cleaner than that, but it's because it
doesn't include system_category(). Here it is in libc++:
https://github.com/llvm-mirror/libcxx/blob/master/src/system_error.cpp#L211

MS's code is even more convoluted because their <system_error> works during
process shutdown, after static destruction. But the magic static cost is the
same in either case.


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