diff options
author | Konstantin Käfer <mail@kkaefer.com> | 2018-10-18 17:57:04 +0200 |
---|---|---|
committer | Konstantin Käfer <mail@kkaefer.com> | 2018-10-23 12:23:40 +0200 |
commit | 70d5972e104aac91f4198540d4af14562e92d555 (patch) | |
tree | 83e92385784d2c89df052690cd3a15ad1ca3eb01 /src/mbgl/text/glyph_range.hpp | |
parent | 282c71e8e9a8ec9c2eab612f2e60a71b15d24c8a (diff) | |
download | qtlocation-mapboxgl-70d5972e104aac91f4198540d4af14562e92d555.tar.gz |
[core] don't use <boost/functional/hash.hpp> to avoid <locale> include
Diffstat (limited to 'src/mbgl/text/glyph_range.hpp')
-rw-r--r-- | src/mbgl/text/glyph_range.hpp | 21 |
1 files changed, 12 insertions, 9 deletions
diff --git a/src/mbgl/text/glyph_range.hpp b/src/mbgl/text/glyph_range.hpp index 74afb73dfc..35a1f74b94 100644 --- a/src/mbgl/text/glyph_range.hpp +++ b/src/mbgl/text/glyph_range.hpp @@ -3,21 +3,24 @@ #include <utility> #include <cstdint> #include <unordered_set> -#include <boost/functional/hash.hpp> +#include <mbgl/util/hash.hpp> namespace mbgl { using GlyphRange = std::pair<uint16_t, uint16_t>; -struct GlyphRangeHash { - std::size_t operator()(const GlyphRange& glyphRange) const { - return boost::hash_value(glyphRange); - } -}; - -using GlyphRangeSet = std::unordered_set<GlyphRange, GlyphRangeHash>; - constexpr uint32_t GLYPHS_PER_GLYPH_RANGE = 256; constexpr uint32_t GLYPH_RANGES_PER_FONT_STACK = 256; } // end namespace mbgl + +namespace std { + +template <> +struct hash<mbgl::GlyphRange> { + std::size_t operator()(const mbgl::GlyphRange& range) const { + return mbgl::util::hash(range.first, range.second); + } +}; + +} // namespace std |