[Development] QHash iteration vs std::unordered_map

Mark Gaiser markg85 at gmail.com
Mon Apr 17 00:09:16 CEST 2017


On Sun, Apr 16, 2017 at 5:53 PM, Thiago Macieira
<thiago.macieira at intel.com> wrote:
> Em domingo, 16 de abril de 2017, às 08:05:21 PDT, Mark Gaiser escreveu:
>> That again makes me wonder, why did Qt diverge from that?
>
> We didn't diverge. We never had that. The Qt style predates the Standard
> Library having relevance in Qt. When the first QHash-like class was added, it
> was just like that.

With regards to QHash vs std::unordered_map, yes.
But STL also has std::map which certainly predates Qt and also gives
back an std::pair.
>
> Also remember that at the time, you wouldn't think of a Standard Library
> associative container as such. It was just a sequential container that held a
> std::pair, with some convenience functions for searching the first of the pair.
> Returning a pair was a consequence of that. I don't know if it was intentional
> thinking, or it just happened.
>
>> And... if Qt plans to change it in Qt6?
>
> No, cannot due to source compatibility. Ever.
>
> --
> 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



More information about the Development mailing list