types: Add STL-compliant Hash functor for Qt types
authorManuel Nickschas <sputnick@quassel-irc.org>
Mon, 15 Oct 2018 19:22:04 +0000 (21:22 +0200)
committerManuel Nickschas <sputnick@quassel-irc.org>
Sun, 18 Nov 2018 10:06:43 +0000 (11:06 +0100)
commit55ed2b3b4fac69d7d4bcb62f312b1fd233626577
treed8dcc591a43f8377fe557b3c273198e7291276d1
parentb8db3c55a7f66a8d6ecabf9039aabceff9ae4837
types: Add STL-compliant Hash functor for Qt types

In order to use Qt types with std::unordered_set (and map), a
compatible hash function needs to be provided. Provide a generic
Hash<T> functor that just uses the qHash() function for the given
type.

This can be used as follows:
    std::unordered_set<QString, Hash<QString>> set;
src/common/types.h