|
Boost : |
From: Vinnie Falco (vinnie.falco_at_[hidden])
Date: 2021-10-20 02:50:06
On Tue, Oct 19, 2021 at 12:54 AM Julien Blanc via Boost
<boost_at_[hidden]> wrote:
> #if __cplusplus >= 201703L
> using filesystem = std::filesystem;
> #else
> using filesystem = boost::variant;
> #endif
> ...
> #if __cplusplus >= 201703L
> using string_view = std::string_view
> #else
> using string_view = boost::string_view
> #endif
This effectively creates 4 different libraries:
{ std::filesystem, std::string_view },
{ boost::variant, std::string_view },
{ std::filesystem, boost::string_view }, and
{ boost::variant, boost::string_view }
I am transitioning away from header-only in favor of compiled
libraries (or including the single-header definitions file src.hpp),
to be responsive to user feedback that Boost libraries "take a long
time to compile and use too many templates" (which sometimes, they
do). Linking to compiled libraries increases the complexity and error
rate of builds so the last thing I want to do is create multiple ABI
forks of my libraries because of #ifdefs on types used in public
interfaces, so this approach is a non-starter.
Thanks
Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk