This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [PATCH] rvalue reference implementation for C++0x


On 3/11/07, Andrew Pinski <pinskia@gmail.com> wrote:
If I understand the "extension" correctly:
int &&a = 1; is valid right?  Why not mark the decl as being an rvalue
reference type instead of making the whole type as a rvalue rerefence?
 It seems to take less memory usage.

Rvalue references are a part of the type system. 'T&&' is a different type from 'T&', with different rules for template argument deduction, substitution of template arguments, and reference binding, and most of these are done without any associated decl.

Now, most of the compiler can treat lvalue and rvalue references
exactly the same. The middle-end won't care at all. The C++ front end
only cares in a few, isolated places. This is the poster boy for a new
flag on REFERENCE_TYPE :)

I'd suggest looking at the actual wording for rvalue references to see
what I mean.

 Cheers,
 Doug


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]