[Interest] QtCreator c++11 integration

Adrian Stern adrian.stern at screenfood.com
Tue Jun 11 07:40:20 CEST 2013

Yes exactly! And in addition when creating a typedef like alias like this:

Using vi = vector<int>;

Using this type should also show the expansion of vector<int>

Vi var;                 // don't know if "new" is neccessary

Freundliche Grüsse / Best Regards / Meilleures salutations
Adrian Stern

-----Original Message-----
From: interest-bounces+adrian.stern=screenfood.com at qt-project.org [mailto:interest-bounces+adrian.stern=screenfood.com at qt-project.org] On Behalf Of Thiago Macieira
Sent: 11 June 2013 01:49
To: interest at qt-project.org
Subject: Re: [Interest] QtCreator c++11 integration

On segunda-feira, 10 de junho de 2013 23.47.04, André Pönitz wrote:
> > Same problem with with "auto"-typed variables. For example when
> > auto-typing a function: Auto class::dostuff() -> vector<int>*;
>    struct Foo { vector<int> *foo() { return new vector<int>(); } };
>    int main() { auto xp = Foo().foo(); xp->@
> also seems to work there.

That's not the feature he requested.

He's asking for this:

struct Foo {
    auto foo() -> vector<int> *
    { return new vector<int>(); }

    auto x = f.foo();

This corresponds to the qcompilerdetection.h macro Q_COMPILER_AUTO_FUNCTION.

Also note that C++14 will allow further reducing this to:
    auto foo()
    { return new vector<int>(); }

    auto x = f.foo();

I named that feature Q_COMPILER_AUTO_RETURN_TYPE in my branch, but I don't like the name. The committee is referring to this feature as "generalised lambda" (or something similar, I have to go find the expression) because it is similar to what you can do with a lambda:

    auto foo = []() { return new vector<int>(); }
    auto x = foo();

In other words, there are two features we're looking for here:
 1) supporting the new style function declaration from C++11
 2) inferring the type from a function body, as in:

    []() { return new vector<int>(); } ()->@

In all the cases above, @ should be showing the expansion of vector<int>.

Thiago Macieira - thiago.macieira (AT) intel.com
  Software Architect - Intel Open Source Technology Center
Diese E-Mail und ihre Anhänge enthalten vertrauliche und/oder rechtlich geschützte Informationen. Wenn Sie nicht der richtige Adressat sind oder diese E-Mail irrtümlich erhalten haben, informieren Sie bitte sofort den Absender und vernichten Sie diese Mail inklusive Anhänge. Das unerlaubte Kopieren sowie die unbefugte Weitergabe der Inhalte dieser Mail ist nicht gestattet.
This e-mail and any attachments may contain confidential and/or privileged information. If you are not the intended recipient (or have received this e-mail in error) please notify the sender immediately and destroy this e-mail including the attachments. Any unauthorized copying, disclosure or distribution of the material in this e-mail is strictly forbidden.

More information about the Interest mailing list