From 944653463fe4134c82d85e2d01e2bc0fa43fd727 Mon Sep 17 00:00:00 2001 From: Kitsune Ral Date: Thu, 12 Sep 2019 11:12:37 +0900 Subject: Introduce HashQ<> and UnorderedMap<> Invading into std:: is frowned upon, even though legitimate from the C++ standard perspective. Given that it's possible to pass a hash object to unordered_map, it only takes an alias for std::unordered_map to avoid having to specialize std::hash. And besides, a generic compatibility bridge between qHash and std::hash has been long needed. std::hash in converters.h remains for now; it will be dropped separately when the API files get regenerated to use UnorderedMap. --- lib/converters.h | 14 ++++---------- 1 file changed, 4 insertions(+), 10 deletions(-) (limited to 'lib/converters.h') diff --git a/lib/converters.h b/lib/converters.h index 587e4544..b753a80b 100644 --- a/lib/converters.h +++ b/lib/converters.h @@ -28,16 +28,10 @@ #include #include -#include #include -#if 0 // Waiting for C++17 -# include - -template -using optional = std::experimental::optional; -#endif // Enable std::unordered_map +// REMOVEME in favor of UnorderedMap, once we regenerate API files namespace std { template <> struct hash { @@ -296,9 +290,9 @@ struct HashMapFromJson { } }; -template -struct JsonObjectConverter> - : public HashMapFromJson> {}; +template +struct JsonObjectConverter> + : public HashMapFromJson> {}; template struct JsonObjectConverter> -- cgit v1.2.3