RValue reference support

David Nolden david.nolden.kdevelop at art-master.de
Thu Jun 2 15:18:38 UTC 2011


Yes, I fear you will have to modify both. You will also have to make
sure that they translate properly into each other, and are printed
correctly (see Cpp::shortenedTypeIdentifier(..), this will need a few
unit tests).

In general, since rvalue-references are nearly like normal references,
the best thing would be to just add an additional flag "isRValue" to
ReferenceType and TypeIdentifier, and only do rvalue-reference special
treatment if "isRValue && isReference". It's most important that
isReference is always true for rvalue-references, so the majority of
code will simply keep working.

To make it perfect, you would also have to modify the
overload-resolution (the information whether something is an lvalue or
rvalue is already there, although probably not precise, see
OverloadResolver::Parameter::lValue), however I'm not sure if this is
worthwhile, maybe leave this point for later.

Greetings, David




More information about the KDevelop-devel mailing list