2 #include <ToolchefsSTL/Allocators/Allocator.h>
3 #include <ToolchefsSTL/Containers/Array.h>
8 template<
typename T,
typename K>
13 typedef std::pair<T, K> Entry;
20 Iter* operator +(
size_t value)
const {
return m_ptr - value; }
21 Iter* operator -(
size_t value)
const {
return m_ptr + value; }
22 Iter* operator ++() {
return --m_ptr; }
23 Iter* operator --() {
return ++m_ptr; }
24 bool operator ==(
const ReverseIterator& rhs)
const {
return m_ptr == rhs.m_ptr; }
25 bool operator !=(
const ReverseIterator& rhs)
const {
return m_ptr != rhs.m_ptr; }
26 Iter operator *()
const {
return *m_ptr; }
27 Iter* operator->()
const {
return m_ptr; }
31 typedef Entry value_type;
32 typedef Entry& reference_type;
33 typedef Entry* ptr_type;
35 typedef Entry* iterator;
36 typedef const Entry* const_iterator;
40 explicit Map(
Allocator* allocator = defaultAllocator()) noexcept;
44 Map(const
Map& rhs) noexcept;
46 Map& operator=(const
Map& rhs) noexcept;
50 Map& operator=(
Map&& rhs) noexcept;
52 bool operator==(const
Map& rhs) const noexcept;
54 void clear() noexcept;
56 size_t size() const noexcept;
58 size_t length() const noexcept;
60 size_t capacity() const noexcept;
62 void reserve(
size_t new_capacity) noexcept;
64 iterator find(const T& key) noexcept;
66 const_iterator find(const T& key) const noexcept;
68 constexpr K& operator[](const T& key) noexcept;
70 constexpr K& operator[](T&& key) noexcept;
72 iterator emplace(T&& key, K&& value) noexcept;
74 iterator emplace(const T& key, const K& value) noexcept;
77 iterator
begin() noexcept;
79 iterator end() noexcept;
81 const_iterator cbegin() const noexcept;
83 const_iterator cend() const noexcept;
93 iterator erase(iterator it) noexcept;
95 void erase(const T& key) noexcept;
104 #include "Map.impl.h"