Skip to content

C++20 and beyond (cppwinrt v3) #1123

@kennykerr

Description

@kennykerr

cppwinrt v2 is based on C++17, which lacks a number of new features that may be of some benefit to the cppwinrt library. I'm starting to experiment with cppwinrt v3 and what it would look like to adopt some of the C++ language and library features introduced in C++20 and C++23. cppwinrt v2 already supports C++20 coroutines but some other features are harder to introduce without more substantial and breaking changes. Here's a starting list of what I'd like to see in v3. Feel free to comment on other features that you think might be beneficial.

C++20

  • Three-way comparison - to simplify comparison generation
  • Modules - to simplify and reduce build time
  • Concepts - to simplify implementations
  • Ranges - to simplify collections
  • span - to replace array_view

C++23

  • Deducing this - to simplify and reduce CRTP complexity & support the builder pattern

It should be clear that the theme is make things simpler and not just adding more bells and whistles. If we find that adding support for X makes things more complicated, then we'd be far less likely to adopt it. By themselves, the C++20 features aren't really compelling enough to spin up a v3 of cppwinrt, but C++23's "deducing this" feature could potentially move the needle so I'm thinking of target C++23 as the min version.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions