[Development] QHash iteration vs std::unordered_map
corentin.jabot at gmail.com
Fri Apr 21 01:57:41 CEST 2017
Here is a solution using range-v3
- there is of course room for improvement :)
2017-04-20 19:28 GMT+02:00 Matthew Woehlke <mwoehlke.floss at gmail.com>:
> On 2017-04-20 13:18, Sergio Martins wrote:
> > On 2017-04-20 18:06, Matthew Woehlke wrote:
> >> for (auto i : qtEnumerate(my_hash))
> >> do_stuff(i.key(), i.value());
> > That doesn't work with temporaries, does it ?
> No. Neither does std::add_const / qAsConst.
> > Maybe something to fix in the C++ language, since the usual
> > lifetime-extension tricks don't help in this case.
> There has been talk, but TTBOMK no concrete proposals yet. (IIRC the
> `register` proposal was published but the author decided not to present
> it yet.)
> Development mailing list
> Development at qt-project.org
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the Development