Boost logo

Boost :

From: Antony Polukhin (antoshkka_at_[hidden])
Date: 2020-08-23 08:23:48


On Sun, Aug 23, 2020, 10:13 Mike via Boost <boost_at_[hidden]> wrote:

> <...>
> I think the real problem is that - due to the structural differences it
> may not be possible to conditionally turn a header file into a module
> interface unit just with a bunch of #ifdefs in a convenient manner, and
> even if you could, code using boost modules could not coexist with code
> using boost headers.
>

I think that it is solvable. In each header put something like that in the
beginning:

#if defined(__cpp_modules) && !defined(BOOST_VARIANT_BUILD_MODULE)
import boost.variant
#else

 // include guards
#ifndef BOOST_VARIANT_HPP
#define BOOST_VARIANT_HPP

#endif

#endif

Now `import boost.variant;` and `#include <boost/variant.hpp>` could
coexist. Also all the users just gain the benefits of modules if compiler
supports them.

>


Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk