Marc Mutz schreef op 17-7-2015 om 12:21: > > What might also be a consideration when making a container like this, is > that I find the key is often (not always of course) already part of the > value data structure. For instance, if I store employee records and key > them by id, that id is also in the record itself. It would be nice to > have a fast and friendly key-based container that could handle that > without duplicating the data... > You can have that with C++11 std::*set, and a custom transparent comparator, > but of course, they are not cache-friendly. But it's testament to the value of > having the ability to _have_ a custom comparator. QFashHash consequently has > that ability, but its a map, not a set, so it won't fit your use-case. > I guess this [1] would work, but that is C++14, not 11. Otherwise, I don't quite see how to retreive my Employee record again if I just have the id...
André [1] http://en.cppreference.com/w/cpp/container/set/find variants 3 and 4 _______________________________________________ Development mailing list [email protected] http://lists.qt-project.org/mailman/listinfo/development
