-
Notifications
You must be signed in to change notification settings - Fork 7
/
Copy pathunordered_map.h
55 lines (46 loc) · 1.93 KB
/
unordered_map.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
///////////////////////////////////////////////////////////////////////////////
// Copyright (c) Electronic Arts Inc. All rights reserved.
///////////////////////////////////////////////////////////////////////////////
#ifndef EASTL_UNORDERED_MAP_H
#define EASTL_UNORDERED_MAP_H
#include <eastl/internal/config.h>
#include <eastl/hash_map.h>
#if defined(EASTL_PRAGMA_ONCE_SUPPORTED)
#pragma once // Some compilers (e.g. VC++) benefit significantly from using this. We've measured 3-4% build speed improvements in apps as a result.
#endif
namespace eastl
{
/// unordered_map
///
/// The original TR1 (technical report 1) used "hashMap" to name a hash
/// table backed associative container of unique key-value pairs. When the
/// container was added to the C++11 standard the committee chose the name
/// "unordered_map" to clarify that internally the elements are NOT sorted in
/// any particular order. We provide a template alias here to ensure feature
/// parity with the original eastl::hashMap.
///
#if !defined(EA_COMPILER_NO_TEMPLATE_ALIASES)
template <typename Key,
typename T,
typename Hash = eastl::hash<Key>,
typename Predicate = eastl::equal_to<Key>,
typename Allocator = EASTLAllocatorType,
bool bCacheHashCode = false>
using unordered_map = hashMap<Key, T, Hash, Predicate, Allocator, bCacheHashCode>;
#endif
/// unordered_multimap
///
/// Similar template alias as "unordered_map" except the contained elements
/// need not be unique. See "hashMultimap" for more details.
///
#if !defined(EA_COMPILER_NO_TEMPLATE_ALIASES)
template <typename Key,
typename T,
typename Hash = eastl::hash<Key>,
typename Predicate = eastl::equal_to<Key>,
typename Allocator = EASTLAllocatorType,
bool bCacheHashCode = false>
using unordered_multimap = hashMultimap<Key, T, Hash, Predicate, Allocator, bCacheHashCode>;
#endif
} // namespace eastl
#endif // Header include guard