C++ Logo

std-proposals

Advanced search

Re: [std-proposals] [DRAFT PAPER] Allowing the establishment of namespace scopes in an export-declaration

From: Zopolis0 <creatorsmithmdt_at_[hidden]>
Date: Wed, 14 Sep 2022 15:20:32 +1000
Fair enough. I didn't fully consider the implications. Given what you have
raised, I am going to initiate a sick flip in the aisle and now advocate
that namespaces can be declared in module interface partitions. Any
partition can declare any namespace, and they will all behave as normal.

Normal, for clarity, is as such where:


export module bar namespace foo;

export int frob
{
  return 1;
}

int strob
{
  return 2;
}

is equivalent to
export module bar;

namespace foo
{
  export int frob
  {
    return 1;
  }
}

int strob
{
  return 2;
}

Does that make sense? Where exported names have an implied namespace block
wrapping around them?

Received on 2022-09-14 05:20:46