Topic: Proposal. In an return statement expression, a local
Author: Mikhail Semenov <mikhailsemenov1957@gmail.com>
Date: Mon, 21 Apr 2014 11:13:54 -0700 (PDT)
Raw View
------=_Part_5_17567764.1398104034924
Content-Type: text/plain; charset=UTF-8
I would like to propose: in a return statement expression if a local
variable (which is not defined as an lvalue reference) and occurs only once
should be treated as an rvalue.
If this is adopted we won't have to write forwarding in most cases.
Instead of writing:
template <class ... T>
void g(T&& ... t)
{
return f(std::forward<T>(t)...);
}
we will be able to write
template <class ... T>
void g(T&& ... t)
{
return f(t...);
}
Basically, it's an extension to the existing return x; where x is a local
variable.
--
---
You received this message because you are subscribed to the Google Groups "ISO C++ Standard - Future Proposals" group.
To unsubscribe from this group and stop receiving emails from it, send an email to std-proposals+unsubscribe@isocpp.org.
To post to this group, send email to std-proposals@isocpp.org.
Visit this group at http://groups.google.com/a/isocpp.org/group/std-proposals/.
------=_Part_5_17567764.1398104034924
Content-Type: text/html; charset=UTF-8
Content-Transfer-Encoding: quoted-printable
<div dir=3D"ltr"><p>I would like to propose: in a return statement expressi=
on if a local variable (which is not defined as an lvalue reference) and oc=
curs only once should be treated as an rvalue.</p><p>If this is adopted we =
won't have to write forwarding in most cases.</p><p>Instead of writing:</p>=
<p>template <class ... T><br>void g(T&& ... t)<br>{<br> =
return f(std::forward<T>(t)...);<br>}</p><p>we will be able to=
write</p><p>template <class ... T><br>void g(T&& ... t)<br>{=
<br> return f(t...);<br>}</p><div>Basically, it's an extension =
to the existing return x; where x is a local variable.</div><div><br></div>=
</div>
<p></p>
-- <br />
<br />
--- <br />
You received this message because you are subscribed to the Google Groups &=
quot;ISO C++ Standard - Future Proposals" group.<br />
To unsubscribe from this group and stop receiving emails from it, send an e=
mail to <a href=3D"mailto:std-proposals+unsubscribe@isocpp.org">std-proposa=
ls+unsubscribe@isocpp.org</a>.<br />
To post to this group, send email to <a href=3D"mailto:std-proposals@isocpp=
..org">std-proposals@isocpp.org</a>.<br />
Visit this group at <a href=3D"http://groups.google.com/a/isocpp.org/group/=
std-proposals/">http://groups.google.com/a/isocpp.org/group/std-proposals/<=
/a>.<br />
------=_Part_5_17567764.1398104034924--
.