26#include <unordered_map>
46template <
class T,
class R,
class Hash = std::hash < T >,
class KeyEqual = std::equal_to < T >,
class Alloc = std::allocator < std::pair < const T, R > > >
47class unordered_map :
public std::unordered_map < T, R, Hash, KeyEqual, Alloc > {
52 using std::unordered_map < T, R, Hash, KeyEqual, Alloc >::unordered_map;
57 using std::unordered_map < T, R, Hash, KeyEqual, Alloc >::operator =;
92 template <
class Iterator >
100 using iterator =
typename std::unordered_map<T, R, Hash, KeyEqual, Alloc>::iterator;
106 using std::unordered_map< T, R, Hash, KeyEqual, Alloc >::insert;
117 std::pair < iterator, bool >
insert (
const T & key,
const R & value ) {
130 std::pair < iterator, bool >
insert (
const T & key, R && value ) {
143 std::pair < iterator, bool >
insert ( T && key,
const R & value ) {
156 std::pair < iterator, bool >
insert ( T && key, R && value ) {
187 return make_map_move_iterator < T, R > ( this->
begin ( ) );
217 return make_map_move_iterator < T, R > ( this->
end ( ) );
227 auto endIter =
end ( );
228 auto beginIter =
begin ( );
239 auto endIter =
end ( );
240 auto beginIter =
begin ( );
251 auto endIter = std::move ( * this ).end ( );
252 auto beginIter = std::move ( * this ).begin ( );
270template<
class T,
class R,
class ... Ts >
276 if(!first) out <<
", ";
278 out <<
"(" << item.first <<
", " << item.second <<
")";
Implementation of iterator_range, i.e. pair of iterators. The class provides most notably begin and e...
Definition: range.hpp:24
Class extending the unordered_map class from the standard library. Original reason is to allow printi...
Definition: unordered_map.hpp:47
unordered_map(const unordered_map &other)=default
unordered_map & operator=(unordered_map &&other)=default
unordered_map(const ext::iterator_range< Iterator > &range)
Definition: unordered_map.hpp:93
std::pair< iterator, bool > insert(const T &key, const R &value)
Insert variant with explicit key and value parameters.
Definition: unordered_map.hpp:117
auto end() const &
Inherited behavior of end for const instance.
Definition: unordered_map.hpp:206
auto range() &&
Make range of move begin to end iterators.
Definition: unordered_map.hpp:250
auto begin() &
Inherited behavior of begin for non-const instance.
Definition: unordered_map.hpp:166
std::pair< iterator, bool > insert(const T &key, R &&value)
Insert variant with explicit key and value parameters.
Definition: unordered_map.hpp:130
auto range() const &
Make range of non-const begin to end iterators.
Definition: unordered_map.hpp:238
auto end() &&
New variant of end for rvalues.
Definition: unordered_map.hpp:216
std::pair< iterator, bool > insert(T &&key, R &&value)
Insert variant with explicit key and value parameters.
Definition: unordered_map.hpp:156
auto range() &
Make range of non-const begin to end iterators.
Definition: unordered_map.hpp:226
auto begin() &&
New variant of begin for rvalues.
Definition: unordered_map.hpp:186
unordered_map(unordered_map &&other)=default
std::pair< iterator, bool > insert(T &&key, const R &value)
Insert variant with explicit key and value parameters.
Definition: unordered_map.hpp:143
auto begin() const &
Inherited behavior of begin for const instance.
Definition: unordered_map.hpp:176
auto end() &
Inherited behavior of end for non-const instance.
Definition: unordered_map.hpp:196
typename std::unordered_map< T, R, Hash, KeyEqual, Alloc >::iterator iterator
The iterator type is inheried.
Definition: unordered_map.hpp:100
Definition: sigHandler.cpp:20
constexpr auto make_pair(T1 &&x, T2 &&y)
Definition: pair.hpp:79
std::ostream & operator<<(ext::reference_wrapper< std::ostream > &os, std::ostream &(*const func)(std::ostream &))
Overloaded function allowing same operations on wrapped output stream as on the actual output stream,...
Definition: GlobalData.cpp:33
auto begin(Container &&cont) -> decltype(std::forward(cont).begin())
Definition: iterator.hpp:900
void end()
Definition: measurements.cpp:19