C++ Logo

std-proposals

Advanced search

Re: [std-proposals] Export namespaces without namespace block, only keyword (modules)

From: Bo Persson <bo_at_[hidden]>
Date: Mon, 15 Aug 2022 10:32:04 +0200
On 2022-08-15 at 09:46, Zopolis0 via Std-Proposals wrote:
> In short-- I propose that there should be a way (if not multiple) to
> export functions within a namespace from a module without having to wrap
> the functions in a namespace block.
> A few possibilities for the syntax of doing so are presented below,
> along with the rationale.
> Suggestions for alternative/additional syntaxes or improvements on the
> ones proposed would be welcome.
> Briefly:
> Instead of
> export module foo;
>
> export namespace foo
> {
> void bar();
> }
> Allow the usage of
> export module foo;
> export namespace foo void bar();
>

You can already do

export namespace foo { void bar(); }

so not that much of an improvement, is it?

Received on 2022-08-15 08:32:10