Am 02.01.2018 um 23:24 schrieb Giuseppe D'Angelo:
But this doesn't really require a "generic iterator class", does it? The function looked for here is really some variation around this:

template <typename K, typename V>
auto mapKeysToVector(const QMap<K, V> &map)
{
    QVector<K> result;
    result.reserve(map.size());
    std::copy(map.keyBegin(), map.keyEnd(), std::back_inserter(result));
    return result;
}

The question is more broad and about how to avoid similar functions popping up everywhere in Qt codebase. I don't have a good answer for that except for "please start collecting them somewhere in the QtPrivate namespace".
Correct - but I now added the four lines because I could not find a second place during a short search so I had no reason to add a function... but still thinking it would be a good idea to have such helpers somewhere.

Christian

btw: still on interest, but now it's too late ;)
_______________________________________________
Interest mailing list
[email protected]
http://lists.qt-project.org/mailman/listinfo/interest

Reply via email to