Re: Overloading on rvalue and lvalue references
on Sat Sep 12 2009, SG <s.gesemann-AT-gmail.com> wrote:
On 11 Sep., 20:59, Paul Bibbings wrote:
I am just starting to come to grips with rvalue references and how
they may be applied in several of the expected 'conventional' uses.
However, in some cases I find I have doubts based on an uncertainty
as to how well my compiler (gcc-4.3.2, Cygwin) actually implements
the current C++0x proposals for rvalue refs
It doesn't, actually. The following code still compiles with GCC 4.3
and GCC 4.4 in C++0x-mode but is NOT allowed anymore for safety
reasons
int main() {
int i = 42;
int&& r = i; // rv-ref to lvalue, ill-formed in C++0x
}
See N2812 for an introduction and N2844 for a detailed wording.
<shameless class="plug">
Also a pretty good series of articles at http://cpp-next.com that cover
these topics
</shameless>
--
Dave Abrahams
BoostPro Computing
http://www.boostpro.com
[ See http://www.gotw.ca/resources/clcm.htm for info about ]
[ comp.lang.c++.moderated. First time posters: Do this! ]