Subject: Re: [boost] [system] Header-only Boost.System by default ?
From: Niall Douglas (s_sourceforge_at_[hidden])
Date: 2017-10-09 17:34:14
> Is there any reason why Boost system couldn't be set to be header only
> by default ?
> Defining both macros allows it :
> Â - BOOST_SYSTEM_NO_DEPRECATED
> Â - BOOST_ERROR_CODE_HEADER_ONLY
> This ease, speeds up and reduces binary size greatly, that it's sad that
> non-aware Boost User needs to link to some dll/so/dylib of Boost.System
> per default.
> It has been in many releases of Boost, wouldn't it be good to set it to
> be the default for a next release ?
The only correct and safe way to use error categories is from a shared
library. In header only mode, multiple instances may appear and thus no
longer be proper singletons. Stuff breaks in this situation, badly.
The above macros are provided for those who don't care if error
categories work correctly, or have taken additional measures to ensure
correctness. Turning it on by default would lead to users making broken
code without realising. It's a build config option for *advanced* users
only, ones who know what they're doing.
-- ned Productions Limited Consulting http://www.nedproductions.biz/ http://ie.linkedin.com/in/nialldouglas/
Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk