|
Boost : |
Subject: [boost] [filesystem] imbue in global constructor crashes
From: Peter Bindels (dascandy_at_[hidden])
Date: 2014-08-15 08:54:47
Hi all,
When trying to use a global constructor to set the locale to utf8 for an
entire project, the system failed to start due to global constructor
ordering making the override happen before the std::locale object itself
was initialized.
Looking into the boost::filesystem code for imbue it seemed that there were
a few different implementations, one of which could work. I've tried to
keep the same side conditions and made this same lazy-initialization
approach for all platforms, which should keep working in all the same
conditions and also work for a global constructor overriding the locale.
I've attached the patch.
I hope that this change can be integrated into boost::filesystem or that we
can have a constructive discussion on what solution we should be making.
Best regards,
Peter Bindels
Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk