[Qt-creator] Using C++11 in Creator's source

Mitch Curtis mitch.curtis at digia.com
Wed Mar 5 11:58:41 CET 2014


On 03/05/2014 10:29 AM, Ziller Eike wrote:
>
> On Mar 4, 2014, at 2:09 PM, Daniel Teske <daniel.teske at digia.com> wrote:
>
>> Hi,
>>
>> since we have branched 3.1 from master, master no longer needs to support OS X
>> 10.6. As such I propose, that we open up master for those C++11 features that
>> are supported by VS 2010, g++ 4.5 and clang 3.1.
>>
>> I think it's too early to require a newer version of Visual Studio, though
>> requiring those 3 compilers gives us both *auto* and *lambda*.
>>
>> I suspect that in practice the minimum g++ or clang version will be higher,
>> since practically no one uses those versions any more.
>>
>> We need to extend the coding rules for auto and lambda. Suggestions are
>> welcome for that.
>
> One rule for using “auto” that I’d like to establish, is to use it only “when the type is obvious when reading the code”.
> Of course what that exactly means should be discussed and shown in some examples, and then it’s still up for interpretation.
> E.g.:
>
> Yes:
>
> auto f = new FooBar;
> auto a = new A;
> auto myAction = menu->addAction(…);
> auto it = list.const_iterator();

As someone who hasn't used any C++11 features, I have to ask: what is 
the advantage to this keyword? What is it trying to solve?

>
> No:
>
> auto i = 4; // the difference between “4;” and “4.;” is subtile with big consequences
>
>
>> Ps:
>> Keep merges from 3.1 easy, by not unnecessarily rewriting code. Wait until 3.1
>> is mostly done.
>> _______________________________________________
>> Qt-creator mailing list
>> Qt-creator at qt-project.org
>> http://lists.qt-project.org/mailman/listinfo/qt-creator
>



More information about the Qt-creator mailing list