tdlight/tdutils/td/utils/FlatHashMap.h

29 lines
1.0 KiB
C
Raw Normal View History

2022-02-07 22:42:53 +01:00
//
// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2022
//
// Distributed under the Boost Software License, Version 1.0. (See accompanying
// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
//
2022-02-07 20:40:28 +01:00
#pragma once
2022-03-01 13:16:57 +01:00
//#include "td/utils/FlatHashMapChunks.h"
//#include "td/utils/FlatHashMapLinear.h"
2022-02-07 20:40:28 +01:00
#include <functional>
2022-03-01 13:16:57 +01:00
#include <unordered_map>
#include <unordered_set>
2022-02-18 21:04:25 +01:00
2022-02-07 20:40:28 +01:00
namespace td {
2022-02-11 17:40:16 +01:00
template <class KeyT, class ValueT, class HashT = std::hash<KeyT>, class EqT = std::equal_to<KeyT>>
2022-03-01 13:16:57 +01:00
//using FlatHashMap = FlatHashMapImpl<KeyT, ValueT, HashT, EqT>;
2022-02-21 03:49:59 +01:00
//using FlatHashMap = FlatHashMapChunks<KeyT, ValueT, HashT, EqT>;
2022-03-01 13:16:57 +01:00
using FlatHashMap = std::unordered_map<KeyT, ValueT, HashT, EqT>;
2022-02-11 17:40:16 +01:00
template <class KeyT, class HashT = std::hash<KeyT>, class EqT = std::equal_to<KeyT>>
2022-03-01 13:16:57 +01:00
//using FlatHashSet = FlatHashSetImpl<KeyT, HashT, EqT>;
2022-02-21 03:49:59 +01:00
//using FlatHashSet = FlatHashSetChunks<KeyT, HashT, EqT>;
2022-03-01 13:16:57 +01:00
using FlatHashSet = std::unordered_set<KeyT, HashT, EqT>;
2022-02-11 17:40:16 +01:00
2022-02-07 20:40:28 +01:00
} // namespace td