P2952

Deduced return types for defaulted operator functions

Latest is R4R3

Current C++ forbids explicitly defaulted functions to have placeholder return types such as `auto&`, except for C++20’s `operator<=>`. We remove this syntactic restriction in cases where the deduced return type would be the same as the expected one. This allows more consistency and less repetition when declaring defaulted functions.

Authors
Arthur O'Dwyer, Matthew Taylor
Mailing
2026-09
Doc date
2026-09-17
Audience
CWG

Revision history

  1. 2026-10
    R4 CWG

    Deduced return types for defaulted operator functions

  2. 2026-09
    R3 Selected (shown above)