[Development] QList

Martin Smith Martin.Smith at qt.io
Wed Mar 22 08:39:03 CET 2017


>The whole issue here is the "sure it is longer".


It's not the WHOLE issue. If you encounter...


auto keys = theHash.keys();


...in someone's code, you have to look around in the rest of the code to figure out what keys is, unless you are already familiar with the keys() function for whatever theHash is.

________________________________
From: Development <development-bounces+martin.smith=qt.io at qt-project.org> on behalf of Thiago Macieira <thiago.macieira at intel.com>
Sent: Wednesday, March 22, 2017 7:43:04 AM
To: development at qt-project.org
Subject: Re: [Development] QList

Em terça-feira, 21 de março de 2017, às 22:49:42 PDT, André Somers escreveu:
> QVector<MyKeyType> keys;
> keys.reserve(theHash.size());
> std::copy(theHash.keyBegin(), theHash.keyEnd(), std::back_inserter(keys));
>
> Sure, it is longer than
> auto keys = theHash.keys();

The whole issue here is the "sure it is longer".

--
Thiago Macieira - thiago.macieira (AT) intel.com
  Software Architect - Intel Open Source Technology Center

_______________________________________________
Development mailing list
Development at qt-project.org
http://lists.qt-project.org/mailman/listinfo/development
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.qt-project.org/pipermail/development/attachments/20170322/0861e5af/attachment.html>


More information about the Development mailing list