|
Boost : |
From: Peter Dimov (pdimov_at_[hidden])
Date: 2020-12-01 21:42:00
Antony Polukhin wrote:
> > My alternative idea of "nice to have" is a single Boost library that can
> > use either boost or std components in its interface. That's not always
> > possible to obtain though.
>
> I've tried that and it kind of works. There are still problems:
> * users have to use macro to customize the library
> * bcp still pulls in the Boost alternatives
> * code redability suffers from typedefs
> * you still kind of have two different libraries
>
> Here's how it works on Boost.DLL:
> * users define BOOST_DLL_USE_STD_FS
> * bcp still puls in Boost.Filesystem, Boost.System...
> * boost::dll::fs::path = std::conditional_t<a-lot-of-mess>
> * code in incompatible with the library that was build without
> BOOST_DLL_USE_STD_FS
That's not what I have in mind. Macros don't solve the problem. What I have
in mind is that there is a single library that, in its interface, can
seamlessly take either boost::fs::path or std::fs::path, without the user
having to define anything.
Of course, when building the library, you probably would need to have
Boost.Filesystem available.
Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk