diff options
author | Maxim Pimenov <m@maps.me> | 2019-02-13 20:42:00 +0300 |
---|---|---|
committer | Tatiana Yan <tatiana.kondakova@gmail.com> | 2019-02-15 14:06:19 +0300 |
commit | 229d8a3bcf09e37e2dcff951dc36989720eef274 (patch) | |
tree | 136b402e2ad15bcde9deb978de40ab9fc998c6c9 /search/stats_cache.hpp | |
parent | 1f2aeeb9edcf3769f569ff1472fd2d418acb0502 (diff) |
[search] Got rid of most old style std/ includes.
Diffstat (limited to 'search/stats_cache.hpp')
-rw-r--r-- | search/stats_cache.hpp | 20 |
1 files changed, 11 insertions, 9 deletions
diff --git a/search/stats_cache.hpp b/search/stats_cache.hpp index 946e12a7c7..db04e4878c 100644 --- a/search/stats_cache.hpp +++ b/search/stats_cache.hpp @@ -1,30 +1,33 @@ #pragma once + #include "base/logging.hpp" -#include "std/unordered_map.hpp" -#include "std/utility.hpp" +#include <cstddef> +#include <string> +#include <unordered_map> +#include <utility> namespace search { template <class TKey, class TValue> class Cache { - unordered_map<TKey, TValue> m_map; + std::unordered_map<TKey, TValue> m_map; /// query statistics size_t m_accesses; size_t m_misses; - size_t m_emptyQueriesCount; /// empty queries count at a row - string m_name; /// cache name for print functions + std::size_t m_emptyQueriesCount; /// empty queries count at a row + std::string m_name; /// cache name for print functions public: - explicit Cache(string const & name) + explicit Cache(std::string const & name) : m_accesses(0), m_misses(0), m_emptyQueriesCount(0), m_name(name) { } - pair<TValue &, bool> Get(TKey const & key) + std::pair<TValue &, bool> Get(TKey const & key) { auto r = m_map.insert(make_pair(key, TValue())); @@ -32,7 +35,7 @@ public: if (r.second) ++m_misses; - return pair<TValue &, bool>(r.first->second, r.second); + return std::pair<TValue &, bool>(r.first->second, r.second); } void Clear() @@ -59,5 +62,4 @@ public: } } }; - } // namespace search |