From b9ed80ecc89ad748e7bbf54eb512b835ee323146 Mon Sep 17 00:00:00 2001 From: artemp Date: Thu, 18 Jun 2015 10:10:26 +0200 Subject: [PATCH] add std::hash specialization for mapnik::value --- include/mapnik/value_hash.hpp | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/include/mapnik/value_hash.hpp b/include/mapnik/value_hash.hpp index e0aec264e..33f50fccb 100644 --- a/include/mapnik/value_hash.hpp +++ b/include/mapnik/value_hash.hpp @@ -76,4 +76,17 @@ std::size_t mapnik_hash_value(T const& val) } // namespace mapnik +// support for std::unordered containers +namespace std +{ +template <> +struct hash +{ + size_t operator()(const mapnik::value& val) const + { + return mapnik::mapnik_hash_value(val); + } +}; + + #endif // MAPNIK_VALUE_HASH_HPP