C++ Logo

std-proposals

Advanced search

Re: [std-proposals] Declare multiple aliases at once with `using`.

From: Bo Persson <bo_at_[hidden]>
Date: Thu, 21 Sep 2023 21:37:29 +0200
On 2023-09-21 at 20:31, Ferhat Geçdoğan via Std-Proposals wrote:
> Most of us use aliases for declaring some complex types with less
> keywords, or something else. Like this:
>
> `using usize = unsigned long long;
> using int8 = std::int8_t;
> using namespace my_namespace;` etc.
>
> It's doing its job. Although, it looks kinda bad, at least in my
> opinion. So, splitting them with a comma operator with one `using` would
> be a great idea. We are doing same thing in variable declarations:
>
> `int x { 42 }, *y;`
>
> With that suggested feature, we can use one `using` for multiple alias
> declarations. Like this:
>
> `using usize = unsigned long long,
> int8 = std::int8_t,
> namespace my_namespace;`.
>
> Isn't that useful?
>

No.

The variable declaration syntax comes from C, and is totally ugly.

Received on 2023-09-21 19:37:36