Peter's LWG defect resolution - as far as I understand it - needs some extra compiler magic in the form of Immortalize.
No, you're reading that incorrectly, it requires no compiler magic, it's implementable today. In the typical case it's just
extern const __system_category_impl __syscat;
constexpr error_category const& system_category() { return __syscat; }
When I proposed that, Billy O'Neal from MS objected that their system_category does extra "immortalization" so constexpr is unimplementable. So I gave a proof of concept of how their "immortalization" can be implemented to still be constexpr.
I should probably just add the relevant constexpr's to Boost.System.
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. MSVC's Immortalize is a directive to the VC runtime to ensure a single instance ever. It really cannot be made constexpr because it uses a runtime lookup table. At least, that's how STL explained it to me. You can see some godbolt on this at https://godbolt.org/g/3TtFsu. Search for std::_Immortalizestd::_System_error_category. Niall -- ned Productions Limited Consulting http://www.nedproductions.biz/ http://ie.linkedin.com/in/nialldouglas/