Boost logo

Boost :

From: William Linkmeyer (wlink10_at_[hidden])
Date: 2022-04-05 18:42:47


>> Neil Douglas wrote:
>> It's clever enough to interpret an include
>> as an import. So no need.

I know this is the case with clang, but what about gcc and msvc?

>> Peter Dimov wrote:
>> My ambitions are modest. All I want is to be able to do this:
>> #if BOOST_MODULES_SUPPORTED
>>
>> import <cstddef>;
>> import <type_traits>;
>> import <exception>;
>> import <initializer_list>;
>> import <utility>;
>> import <functional>; // std::hash
>> import <cstdint>;
>> import <iosfwd>;
>>
>> #else
>>
>> #include <cstddef>
>> #include <type_traits>
>> #include <exception>
>> #include <initializer_list>
>> #include <utility>
>> #include <functional> // std::hash
>> #include <cstdint>
>> #include <iosfwd>
>>
>> #endif

You may also want to declare the above as a module itself so you can import it elsewhere :)

>> John Maddock wrote:
>
>> Is there any existing best practice we should follow yet?

Unfortunately, not yet. And I’m not sure that there will be — at least not until some package management support makes its way into the standard.

WL

> On Apr 5, 2022, at 2:31 PM, Peter Dimov via Boost <boost_at_[hidden]> wrote:
>
> Daniela Engert wrote:
>> Right, but this part of the standard is optional. MSVC has it but not the others,
>> right?
>
> I can find /translateInclude in the documentation but according to the
> description it doesn't automatically translate stdlib includes.
>
>
> _______________________________________________
> Unsubscribe & other changes: http://lists.boost.org/mailman/listinfo.cgi/boost


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