Thea
UnorderedMap.hpp
1 //============================================================================
2 //
3 // This file is part of the Thea toolkit.
4 //
5 // This software is distributed under the BSD license, as detailed in the
6 // accompanying LICENSE.txt file. Portions are derived from other works:
7 // their respective licenses and copyright information are reproduced in
8 // LICENSE.txt and/or in the relevant source files.
9 //
10 // Author: Siddhartha Chaudhuri
11 // First version: 2011
12 //
13 //============================================================================
14 
15 #ifndef __Thea_UnorderedMap_hpp__
16 #define __Thea_UnorderedMap_hpp__
17 
18 #include "Platform.hpp"
19 #include <unordered_map>
20 
21 namespace Thea {
22 
24 template < typename Key,
25  typename T,
26  typename Hash = std::hash<Key>,
27  typename Pred = std::equal_to<Key>,
28  typename Alloc = std::allocator< std::pair<Key const, T> >
29  > using UnorderedMap = std::unordered_map<Key, T, Hash, Pred, Alloc>;
30 
32 template < typename Key,
33  typename T,
34  typename Hash = std::hash<Key>,
35  typename Pred = std::equal_to<Key>,
36  typename Alloc = std::allocator< std::pair<Key const, T> >
37  > using UnorderedMultiMap = std::unordered_multimap<Key, T, Hash, Pred, Alloc>;
38 
39 } // namespace Thea
40 
41 #endif
std::unordered_multimap< Key, T, Hash, Pred, Alloc > UnorderedMultiMap
Hash table-based mapping from (possibly duplicate) keys to values.
Root namespace for the Thea library.
std::unordered_map< Key, T, Hash, Pred, Alloc > UnorderedMap
Hash table-based mapping from keys to values.
This file must be included in every file in the project, before any other include.