C++ Logo

std-proposals

Advanced search

Re: [std-proposals] Proposal for Uniform Forward And Move

From: Kevin Schmidt <kevin_at_[hidden]>
Date: Mon, 26 Jun 2023 08:47:26 +0200
On Mon, Jun 26, 2023, 08:30 Frederick Virchanza Gotham via Std-Proposals
wrote:

> Personally I like the idea of having '^^' as a unary operator that
> works as either 'move' or 'forward'


I also like the idea of a move operator. But would much prefer something
like:

auto ptr := std::unique_ptr<int>(new int(1));

or

auto ptr <<- std::unique_ptr<int>(new int(2));

Otherwise && would be perfect as it is inline with the function declaration.

auto ptr = &&std::unique_ptr<int>(new int(3));

Am Mo., 26. Juni 2023 um 08:30 Uhr schrieb Frederick Virchanza Gotham via
Std-Proposals <std-proposals_at_[hidden]>:

> > On Wed, Jun 21, 2023 at 5:24 PM Михаил Найденов wrote:
> > >
> > > Proposed is to have a postscript operator &&, which either moves or
> forwards.
>
>
> Personally I like the idea of having '^^' as a unary operator that
> works as either 'move' or 'forward':
>
> template<class T>
> void Func(T &&arg)
> {
> static T obj;
> obj = ^^arg;
> }
> --
> Std-Proposals mailing list
> Std-Proposals_at_[hidden]
> https://lists.isocpp.org/mailman/listinfo.cgi/std-proposals
>

Received on 2023-06-26 06:47:38