C++ Logo

std-proposals

Advanced search

Re: [std-proposals] Function-bound objects with unary operator %

From: Frederick Virchanza Gotham <cauldwell.thomas_at_[hidden]>
Date: Wed, 3 Jun 2026 17:17:15 +0100
On Tuesday, June 2, 2026, Thiago Macieira wrote:

>
>
> There is only one symbolic operator added to C++ since its inception, and
> that's the spaceship one.
>


The number one most convenient unary operator we could add to the language
would be for 'std::forward'. So if you write:

    ?var

then it's the same as:

    (decltype(var)&&)var

with a compulsory compiler warning/error if 'var' is not a function
parameter forwarding reference.

Received on 2026-06-03 16:17:19