Date: Sun, 9 Nov 2025 21:51:21 -0500
On Sun, Nov 9, 2025 at 7:36 PM Budi via Std-Proposals
<std-proposals_at_[hidden]> wrote:
>
> How can I code/write something, for illustration, sort of like:
> using namespace memory::std;
>
> for the need that:
> Only names from <memory> (like std::unique_ptr, std::shared_ptr, etc.) become visible, without bringing in the entire std namespace
> In other words; could allow using namespace std::memory; or similar syntax to only expose symbols from a specific header or subset of a namespace.
>
> That’s conceptually like “namespace submodules” or such
By the time namespaces exist, headers *don't* exist. So what you're
wanting isn't functionally possible in the language. You'd need the
header to define some kind of linguistic construct that wraps all of
its declarations in. And we already have that: a namespace.
<std-proposals_at_[hidden]> wrote:
>
> How can I code/write something, for illustration, sort of like:
> using namespace memory::std;
>
> for the need that:
> Only names from <memory> (like std::unique_ptr, std::shared_ptr, etc.) become visible, without bringing in the entire std namespace
> In other words; could allow using namespace std::memory; or similar syntax to only expose symbols from a specific header or subset of a namespace.
>
> That’s conceptually like “namespace submodules” or such
By the time namespaces exist, headers *don't* exist. So what you're
wanting isn't functionally possible in the language. You'd need the
header to define some kind of linguistic construct that wraps all of
its declarations in. And we already have that: a namespace.
Received on 2025-11-10 02:51:32
