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: Mon, 12 Sep 2022 17:20:30 +1000
> Your "old.h/cpp" examples don't use namespaces at all. `old` is a
> class, not a namespace.

A typo. Treat it as if I used namespaces.

> Just your example raises many questions.
> For example, what namespace is `foo` in?
It is not in a namespace
> How do you access them if they're not in the namespace?
As you would normally.
> If non-exported names aren't in that namespace, can you define two
> entities, one exported and one not, with the same name and have that
> just work because of the implicit namespace business?
Hmm. In theory, possibly, but that seems messy. I'm going to say no.

> And you never deal with the question of multiple translation units,
> which is at present a complete non-starter.
I asked you for help on this, and you asked for examples.
I gave examples, and now you are asking me the same question that I asked
you for help with.
Regardless, multiple translation units would work the same way as they
would previously, and would not care about the namespace declared in the
primary module interface unit. The only files that would care are files
that import the primary module interface unit, as they would access the
exported name via the declared namespace.

Received on 2022-09-12 07:20:44