C++ Logo

std-proposals

Advanced search

[std-proposals] Grouped-namespace "using" statements (floating the idea)

From: John Filleau <john.filleau_at_[hidden]>
Date: Mon, 24 Apr 2023 10:51:47 -0400
Floating the idea for Grouped-namespace "using" statements.

A grouped-namespace using statement is a shorter way to write multiple
using statements that share a parent namespace.

using a::b::c::X, a::b::c::Y, a::b::c::Z;

can be replaced with

using a::b::c::{X, Y, Z};

PROBLEM

Sometimes I have long namespace names, and I want to alias things from that
namespace. The current way to do that requires me to retype the namespace a
lot. See above.

This is annoying at time-of-writing because of the repetition and
opportunity for typos. This is annoying at time-of-maintenance when
namespace names change.

SOLUTION

Allow grouped-namespace using statements as seen above.

BENEFIT

100% ergonomics.

This solves no interesting computer science problems, nor does it introduce
world peace.

DOWNSIDES

I have 0 understanding of the edge cases around this. I just know I want
it. If other people want it, we should make it part of the standard.

COST

One more thing that implementations have to handle.

Received on 2023-04-24 14:52:01