C++ Logo

std-proposals

Advanced search

Re: const && and for( : ) loop

From: Thiago Macieira <thiago_at_[hidden]>
Date: Wed, 03 Feb 2021 15:58:11 -0800
On Tuesday, 2 February 2021 15:31:27 PST Ryan P. Nicholl via Std-Proposals
wrote:
> Currently for ( : ) loop doesn't extend lifetime of T&&. I suggest, first,
> if the evaluation expression of for ( : ) results in T && type, then all
> temporaries in the object to be iterated upon are extended in lifetime
> until the end of the loop body.

The lifetime extension proposals are meant to address the ranged for problems.
Can you point to a shortcoming in the current proposals?

-- 
Thiago Macieira - thiago (AT) macieira.info - thiago (AT) kde.org
   Software Architect - Intel DPG Cloud Engineering

Received on 2021-02-03 17:58:16