Skip to content

Commit

Permalink
libcore|Block: std::hash function for Block
Browse files Browse the repository at this point in the history
  • Loading branch information
skyjake committed Sep 1, 2019
1 parent 548af76 commit 22edb11
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions doomsday/libs/core/include/de/data/block.h
Expand Up @@ -235,4 +235,14 @@ Block md5Hash(Args... args)

} // namespace de

namespace std
{
template<>
struct hash<de::Block> {
std::size_t operator()(const de::Block &key) const {
return hash<std::string>()({key.data(), key.data() + key.size()});
}
};
}

#endif // LIBCORE_BLOCK_H

0 comments on commit 22edb11

Please sign in to comment.