C++ Logo

std-proposals

Advanced search

[std-proposals] Access specifier for C++ Namespaces

From: Smith, Jim <jim.smith_at_[hidden]>
Date: Sun, 18 Jun 2023 19:41:35 +0000
Hi All,

Years ago I inquired about this, don't know if it was discussed further.

In some cases we might want to limit access for some types declared in a namespace.

Would it be feasible to at least add a private access specifier for Namespaces?

For example:

namespace Foo {
...
private: {
func() {}
};
};

Would make func() accessible only inside the namespace.

Thanks,
- James S.

Received on 2023-06-18 19:41:53