Date: Mon, 21 Sep 2026 10:19:37 +0200
Currently, 'class' and 'struct' are exactly the same (except for the
default access specifier). The standard even allows to mix 'struct' and
'class' in forward declarations (except that MSVC does not support it,
IIRC). So, why should we now start differentiating between classes and
structs?
If I understand the problem correctly, this has to do with a (local)
variable having the same name as the type. We already can always specify
the type explicitly by using its namespace (e.g. std::string or ::MyClass).
What other problem would the tag namespace solve?
Maybe I'm a little unknowledgeable in this area, but what kind of C source
code pertinent to this problem would currently not work in C++?
I hope this proposal is not just about style preferences.
On Mon, Sep 21, 2026 at 9:54 AM Liam Graham via Std-Proposals <
std-proposals_at_[hidden]> wrote:
> Forgot to say. Except for classes, keep the auto injection there. Structs,
> enums, enum classes and unions can be explicitly brought in
>
> Sent from Outlook for iOS <https://aka.ms/o0ukef>
> ------------------------------
> *From:* Liam Graham
> *Sent:* Monday, 21 September 2026 08:51:43
> *To:* std-proposals_at_[hidden] <std-proposals_at_[hidden]>
> *Subject:* PROPOSAL: reintroduce tag namespace
>
> Bringing in tag names to the type namespace automatically can easily lead
> to collisions. Bring back the C-style tag namespace, and let the developer
> bring in the tag name explicitly. Type safety is key in this industry.
>
> Sent from Outlook for iOS <https://aka.ms/o0ukef>
> --
> Std-Proposals mailing list
> Std-Proposals_at_[hidden]
> https://lists.isocpp.org/mailman/listinfo.cgi/std-proposals
>
default access specifier). The standard even allows to mix 'struct' and
'class' in forward declarations (except that MSVC does not support it,
IIRC). So, why should we now start differentiating between classes and
structs?
If I understand the problem correctly, this has to do with a (local)
variable having the same name as the type. We already can always specify
the type explicitly by using its namespace (e.g. std::string or ::MyClass).
What other problem would the tag namespace solve?
Maybe I'm a little unknowledgeable in this area, but what kind of C source
code pertinent to this problem would currently not work in C++?
I hope this proposal is not just about style preferences.
On Mon, Sep 21, 2026 at 9:54 AM Liam Graham via Std-Proposals <
std-proposals_at_[hidden]> wrote:
> Forgot to say. Except for classes, keep the auto injection there. Structs,
> enums, enum classes and unions can be explicitly brought in
>
> Sent from Outlook for iOS <https://aka.ms/o0ukef>
> ------------------------------
> *From:* Liam Graham
> *Sent:* Monday, 21 September 2026 08:51:43
> *To:* std-proposals_at_[hidden] <std-proposals_at_[hidden]>
> *Subject:* PROPOSAL: reintroduce tag namespace
>
> Bringing in tag names to the type namespace automatically can easily lead
> to collisions. Bring back the C-style tag namespace, and let the developer
> bring in the tag name explicitly. Type safety is key in this industry.
>
> Sent from Outlook for iOS <https://aka.ms/o0ukef>
> --
> Std-Proposals mailing list
> Std-Proposals_at_[hidden]
> https://lists.isocpp.org/mailman/listinfo.cgi/std-proposals
>
Received on 2026-09-21 08:20:18
