Skip to content

STL: Down with typename? #3718

@frederick-vs-ja

Description

@frederick-vs-ja

Clang16 has implemented WG21-P0634R3, so we can omit typename in many places since C++20 mode (see WG21-P2150 for possible simplification in library). See also #3694 which drops optional typename in <mdspan>.

For pre-C++20 components, I think we can use the following conditional compilation pattern.

#if _HAS_CXX20
#define _OPT_TYPENAME
#else // ^^^ _HAS_CXX20 / !_HAS_CXX20 vvv
#define _OPT_TYPENAME typename
#endif // ^^^ !_HAS_CXX20 ^^^

I'm not sure whether this would

  • make the code easier to read, and/or
  • improve compiler throughput,

or the way around.

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementSomething can be improvedresolvedSuccessfully resolved without a commit

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions