Cpp Utilities 1.2.3
Classes | Public Types | Public Member Functions | Friends | Related Functions | List of all members
Container::SequencialMap< Key, T, Compare, Allocator > Class Template Reference

Key-value container behaves like std::map, but extended with random-access operations and traverses in the sequence order of value appends like std::vector. More...

#include <SequencialMap.hpp>

Classes

struct  iterator_base
 Base type for iterators. More...
 
struct  key_iterator
 Iterator to traverse keys. More...
 
struct  SerializeManipulator
 Stream manipulator for serialization and deserialization. More...
 

Public Types

using allocator_type = Allocator
 Provide same member type of std::map. More...
 
using map_type = std::map< Key, T, Compare, Allocator >
 Underlying map type for map APIs. More...
 
using vector_type = std::vector< typename map_type::iterator >
 Underlying map type for random-access operations and sequencial traversal. More...
 
using key_type = typename map_type::key_type
 Provide same member type of std::map. More...
 
using mapped_type = typename map_type::mapped_type
 Provide same member type of std::map. More...
 
using key_compare = typename map_type::key_compare
 Provide same member type of std::map. More...
 
using value_compare = typename map_type::value_compare
 Provide same member type of std::map. More...
 
using value_type = typename map_type::value_type
 Provide same member type of std::map. More...
 
using pointer = typename map_type::pointer
 Provide same member type of std::map. More...
 
using const_pointer = typename map_type::const_pointer
 Provide same member type of std::map. More...
 
using reference = typename map_type::reference
 Provide same member type of std::map. More...
 
using const_reference = typename map_type::const_reference
 Provide same member type of std::map. More...
 
using size_type = typename map_type::size_type
 Provide same member type of std::map. More...
 
using difference_type = typename map_type::difference_type
 Provide same member type of std::map. More...
 
using iterator = iterator_base< false >
 Mutable iterator type for LegacyRandomAccessIterator. More...
 
using const_iterator = iterator_base< true >
 Immutable iterator type for constant LegacyRandomAccessIterator. More...
 
using reverse_iterator = std::reverse_iterator< iterator >
 Mutable reverse iterator type. More...
 
using const_reverse_iterator = std::reverse_iterator< const_iterator >
 Immutable reverse iterator type. More...
 
using reverse_key_iterator = std::reverse_iterator< key_iterator >
 Reverse iterator to traverse keys. More...
 

Public Member Functions

 SequencialMap ()
 Default constructor, constructs an empty container. More...
 
 SequencialMap (const Compare &comp, const Allocator &alloc=Allocator())
 Constructs an empty container with given comparator and allocator. More...
 
template<typename InputIt >
 SequencialMap (InputIt first, InputIt last, const Compare &comp=Compare(), const Allocator &alloc=Allocator())
 Constructs the container with the contents of the range [first, last). If multiple elements in the range have keys that compare equivalent, only the first element is inserted. More...
 
template<typename InputIt >
 SequencialMap (InputIt first, InputIt last, const Allocator &alloc)
 Constructs the container with the contents of the range [first, last). If multiple elements in the range have keys that compare equivalent, only the first element is inserted. More...
 
 SequencialMap (const SequencialMap &other, const Allocator &alloc=Allocator())
 Copy constructor. Constructs the container with the copy of the contents of other. If alloc is not provided, allocator is obtained by calling ```cpp std::allocator_traits<allocator_type>::select_on_container_copy_construction(other.get_allocator()) ```. More...
 
 SequencialMap (SequencialMap &&other, const Allocator &alloc=Allocator())
 Move constructor. Constructs the container with the contents of other using move semantics. If alloc is not provided, allocator is obtained by move-construction from the allocator belonging to other. More...
 
 SequencialMap (std::initializer_list< value_type > init, const Compare &comp=Compare(), const Allocator &alloc=Allocator())
 Constructs the container with the contents of the initializer list init. If multiple elements in the range have keys that compare equivalent, only the first element is inserted. More...
 
 ~SequencialMap ()=default
 Destructs the container. The destructors of the elements are called and the used storage is deallocated. Note, that if the elements are pointers, the pointed-to objects are not destroyed. More...
 
allocator_type get_allocator () const
 Returns the allocator associated with the container. More...
 
bool empty () const noexcept
 Checks if the container has no elements, i.e. whether begin() == end(). More...
 
size_type size () const noexcept
 Returns the number of elements in the container, i.e. std::distance(begin(), end()). More...
 
size_type max_size () const noexcept
 Returns the maximum number of elements the container is able to hold due to system or library implementation limitations, i.e. std::distance(begin(), end()) for the largest container. More...
 
void clear () noexcept
 
bool contains (const key_type &key) const
 Checks if there is an element with key equivalent to key in the container. More...
 
iterator find (const key_type &key)
 Finds an element with key equivalent to key. More...
 
const_iterator find (const key_type &key) const
 Finds an element with key equivalent to key. More...
 
template<typename Container = std::vector<key_type>>
Container keys () const
 Returns a list containing all the keys in the map in the sequence order of value appends. More...
 
const key_type key (const T &value, const key_type &defaultKey=key_type()) const
 Returns the key with value value, or defaultKey if the map contains no item with value value. More...
 
template<typename Container = std::vector<T>>
Container values () const
 Returns a list containing all the values in the map in the sequence order of value appends. More...
 
const T & value (const key_type &key, const T &defaultValue=T()) const
 Returns the value associated with the key key. More...
 
reference at (size_type pos)
 Returns a reference to the element at specified location pos, with bounds checking. More...
 
const_reference at (size_type pos) const
 Returns a const reference to the element at specified location pos, with bounds checking. More...
 
T & operator[] (const key_type &key)
 Returns a reference to the value that is mapped to a key equivalent to key, performing an insertion if such key does not already exist. More...
 
T & operator[] (key_type &&key)
 Returns a reference to the value that is mapped to a key equivalent to key, performing an insertion if such key does not already exist. More...
 
const T operator[] (const key_type &key) const
 Returns a copy to the value that is mapped to a key equivalent to key, return a default constructed value if such key does not already exist. More...
 
const T operator[] (key_type &&key) const
 Returns a copy to the value that is mapped to a key equivalent to key, return a default constructed value if such key does not already exist. More...
 
reference front ()
 Returns a reference to the first element in the container. More...
 
const_reference front () const
 Returns a const reference to the first element in the container. More...
 
reference back ()
 Returns a reference to the last element in the container. More...
 
const_reference back () const
 Returns a const reference to the last element in the container. More...
 
SequencialMap mid (size_type pos) const
 Returns a sub-map which contains elements from this map, starting at position pos to the end. More...
 
SequencialMap mid (size_type pos, size_type length) const
 Returns a sub-map which contains elements from this map, starting at position pos, with length elements (or all remaining elements if there are less than length elements) are included. More...
 
std::pair< iterator, bool > push_back (const_reference value)
 Appends the given element value to the end of the container, if the container doesn't already contain an element with an equivalent key. More...
 
std::pair< iterator, bool > push_back (value_type &&value)
 Appends the given element value to the end of the container, if the container doesn't already contain an element with an equivalent key. More...
 
std::pair< iterator, bool > push_back (const key_type &key, const T &value)
 Appends the given element value to the end of the container, if the container doesn't already contain an element with an equivalent key. More...
 
std::pair< iterator, bool > push_back (const key_type &key, T &&value)
 Appends the given element value to the end of the container, if the container doesn't already contain an element with an equivalent key. More...
 
void push_back (const SequencialMap &other)
 Appends all elements from given container other to the end of the container, ignores all values with keys already exists in the container. More...
 
void push_back (std::initializer_list< value_type > ilist)
 Appends all elements from initializer list ilist to the end of the container, ignores all values with keys already exists in the container. More...
 
template<typename InputIt >
void push_back (InputIt first, InputIt last)
 Appends all elements from from range [first, last) to the end of the container, ignores all values with keys already exists in the container. More...
 
template<typename... Args>
std::pair< iterator, bool > emplace_back (const key_type &key, Args &&... args)
 Appends a new element to the end of the container. More...
 
template<typename... Args>
std::pair< iterator, bool > emplace_back (key_type &&key, Args &&... args)
 Appends a new element to the end of the container. More...
 
SequencialMap operator+ (const SequencialMap &other) const
 Same as push_back, appends all elements from given container other to the end of the container, ignores all values with keys already exists in the container. More...
 
SequencialMap operator+ (SequencialMap &&other) const
 Same as push_back, appends all elements from given container other to the end of the container, ignores all values with keys already exists in the container. More...
 
SequencialMapoperator+= (const SequencialMap &other)
 Same as push_back, appends all elements from given container other to the end of the container and return *this, ignores all values with keys already exists in the container. More...
 
SequencialMapoperator+= (SequencialMap &&other)
 Same as push_back, appends all elements from given container other to the end of the container and return *this, ignores all values with keys already exists in the container. More...
 
iterator insert (size_t pos, const_reference value)
 Inserts element into the container, if the container doesn't already contain an element with an equivalent key. More...
 
iterator insert (size_t pos, value_type &&value)
 Inserts element into the container, if the container doesn't already contain an element with an equivalent key. More...
 
iterator insert (size_t pos, const key_type &key, const T &value)
 Inserts element into the container, if the container doesn't already contain an element with an equivalent key. More...
 
iterator insert (size_t pos, const key_type &key, T &&value)
 Inserts element into the container, if the container doesn't already contain an element with an equivalent key. More...
 
iterator insert (iterator pos, const_reference value)
 Inserts element into the container, if the container doesn't already contain an element with an equivalent key. More...
 
iterator insert (iterator pos, value_type &&value)
 Inserts element into the container, if the container doesn't already contain an element with an equivalent key. More...
 
iterator insert (iterator pos, const key_type &key, const T &value)
 Inserts element into the container, if the container doesn't already contain an element with an equivalent key. More...
 
iterator insert (iterator pos, const key_type &key, T &&value)
 Inserts element into the container, if the container doesn't already contain an element with an equivalent key. More...
 
template<typename InputIt >
void insert (size_t pos, InputIt first, InputIt last)
 Inserts elements into the container, if the container doesn't already contain an element with an equivalent key. More...
 
void insert (size_t pos, std::initializer_list< value_type > ilist)
 Inserts elements into the container, if the container doesn't already contain an element with an equivalent key. More...
 
template<typename InputIt >
void insert (iterator pos, InputIt first, InputIt last)
 Inserts elements into the container, if the container doesn't already contain an element with an equivalent key. More...
 
void insert (iterator pos, std::initializer_list< value_type > ilist)
 Inserts elements into the container, if the container doesn't already contain an element with an equivalent key. More...
 
template<typename... Args>
std::pair< iterator, bool > emplace_at (size_t pos, const key_type &key, Args &&... args)
 Inserts a new element to the container as close as possible to the position just before hint. The element is constructed in-place, i.e. no copy or move operations are performed. More...
 
template<typename... Args>
std::pair< iterator, bool > emplace_at (size_t pos, key_type &&key, Args &&... args)
 Inserts a new element to the container as close as possible to the position just before hint. The element is constructed in-place, i.e. no copy or move operations are performed. More...
 
template<typename... Args>
iterator emplace_hint (const_iterator hint, key_type &&key, Args &&... args)
 Inserts a new element to the container as close as possible to the position just before hint. The element is constructed in-place, i.e. no copy or move operations are performed. More...
 
void pop_back ()
 Removes the last element of the container. More...
 
void erase (const key_type &key)
 Removes specified element from the container. More...
 
void erase (size_type pos, size_type count=1)
 Removes specified elements from the container. More...
 
iterator erase (const_iterator pos)
 Removes specified elements from the container. More...
 
iterator erase (const_iterator first, const_iterator last)
 Removes specified elements from the container. More...
 
iterator begin ()
 Returns an iterator to the first element of the container.
If the container is empty, the returned iterator will be equal to end(). More...
 
const_iterator begin () const
 Returns an iterator to the first element of the container.
If the container is empty, the returned iterator will be equal to end(). More...
 
const_iterator cbegin () const
 Returns an iterator to the first element of the container.
If the container is empty, the returned iterator will be equal to end(). More...
 
iterator end ()
 Returns an iterator to the element following the last element of the container.
This element acts as a placeholder; attempting to access it results in undefined behavior. More...
 
const_iterator end () const
 Returns an iterator to the element following the last element of the container.
This element acts as a placeholder; attempting to access it results in undefined behavior. More...
 
const_iterator cend () const
 Returns an iterator to the element following the last element of the container.
This element acts as a placeholder; attempting to access it results in undefined behavior. More...
 
reverse_iterator rbegin ()
 Returns a reverse iterator to the first element of the reversed container. It corresponds to the last element of the non-reversed container. If the container is empty, the returned iterator is equal to rend(). More...
 
const_reverse_iterator rbegin () const
 Returns a reverse iterator to the first element of the reversed container. It corresponds to the last element of the non-reversed container. If the container is empty, the returned iterator is equal to rend(). More...
 
const_reverse_iterator crbegin () const
 Returns a reverse iterator to the first element of the reversed container. It corresponds to the last element of the non-reversed container. If the container is empty, the returned iterator is equal to rend(). More...
 
reverse_iterator rend ()
 Returns a reverse iterator to the element following the last element of the reversed container. It corresponds to the element preceding the first element of the non-reversed container. This element acts as a placeholder, attempting to access it results in undefined behavior. More...
 
const_reverse_iterator rend () const
 Returns a reverse iterator to the element following the last element of the reversed container. It corresponds to the element preceding the first element of the non-reversed container. This element acts as a placeholder, attempting to access it results in undefined behavior. More...
 
const_reverse_iterator crend () const
 Returns a reverse iterator to the element following the last element of the reversed container. It corresponds to the element preceding the first element of the non-reversed container. This element acts as a placeholder, attempting to access it results in undefined behavior. More...
 
key_iterator key_begin () const
 Returns an iterator to the first key of the container.
If the container is empty, the returned iterator will be equal to end(). More...
 
key_iterator key_end () const
 Returns an iterator to the key following the last key of the container.
This key acts as a placeholder; attempting to access it results in undefined behavior. More...
 
reverse_key_iterator key_rbegin () const
 Returns a reverse iterator to the first key of the reversed container. It corresponds to the last key of the non-reversed container. If the container is empty, the returned iterator is equal to rend(). More...
 
reverse_key_iterator key_rend () const
 Returns a reverse iterator to the key following the last key of the reversed container. It corresponds to the key preceding the first key of the non-reversed container. This key acts as a placeholder, attempting to access it results in undefined behavior. More...
 
SequencialMapoperator= (const SequencialMap &other)
 Replaces the contents of the input container. More...
 
SequencialMapoperator= (SequencialMap &&other)
 Replaces the contents of the input container. More...
 
SequencialMapoperator= (std::initializer_list< value_type > ilist)
 Replaces the contents of the input container. More...
 
bool operator== (const SequencialMap &other) const
 Checks if the contents of two containers are not equal. More...
 
bool operator!= (const SequencialMap &other) const
 Checks if the contents of two containers are equal, that is,. More...
 
bool operator< (const SequencialMap &other) const
 Compares the contents of two containers lexicographically. More...
 
bool operator<= (const SequencialMap &other) const
 Compares the contents of two containers lexicographically. More...
 
bool operator> (const SequencialMap &other) const
 Compares the contents of two containers lexicographically. More...
 
bool operator>= (const SequencialMap &other) const
 Compares the contents of two containers lexicographically. More...
 
void swap (SequencialMap &other)
 Exchanges the contents of the container with those of other. Does not invoke any move, copy, or swap operations on individual elements. More...
 
key_compare key_comp () const
 Returns the function object that compares the keys, which is a copy of this container's constructor argument comp. More...
 
value_compare value_comp () const
 Returns a function object that compares objects of type std::map::value_type (key-value pairs) by using key_comp to compare the first components of the pairs. More...
 
SerializeManipulator serialize () const
 Serialize the contents to output stream. More...
 
SerializeManipulator deserialize ()
 Deserialize the contents from input stream. More...
 

Friends

template<typename Stream >
Stream & operator<< (Stream &out, const SequencialMap &map)
 Writes the contents of list to output stream. More...
 

Related Functions

(Note that these are not member functions.)

template<typename Key , typename T , typename Compare = std::less<Key>, typename Allocator = std::allocator<std::pair<const Key, T>>>
void swap (Container::SequencialMap< Key, T, Compare, Allocator > &lhs, Container::SequencialMap< Key, T, Compare, Allocator > &rhs) noexcept
 Specializes the std::swap algorithm. More...
 
template<class Key , class T , class Compare , class Alloc , class Pred >
void erase_if (Container::SequencialMap< Key, T, Compare, Alloc > &c, Pred pred)
 Erases all elements that satisfy the predicate pred from the container. More...
 

Detailed Description

template<typename Key, typename T, typename Compare = std::less<Key>, typename Allocator = std::allocator<std::pair<const Key, T>>>
class Container::SequencialMap< Key, T, Compare, Allocator >

Key-value container behaves like std::map, but extended with random-access operations and traverses in the sequence order of value appends like std::vector.

Template Parameters
KeyKey type of input maps.
TValue type of input maps.
CompareComparison function object to use for all comparisons of keys.
AllocatorAllocator to use for all memory allocations of this container.

Same API as std::map, but add more APIs from std::vector to extend random-access operations.
All iterators and random-access operations traverse the map in the sequence of value appends like std::vector.

Iterator and Reference Invalidation
Iterator invalidation of modify operations behave like std::vector.
Reference invalidation of modify operations behave like std::map.

Algorithmic Complexity
Most operations of SequencialMap have the same algorithmic complexity as std::map, while random-access operations share the same complexity as std::vector.

Member Typedef Documentation

◆ allocator_type

template<typename Key , typename T , typename Compare = std::less<Key>, typename Allocator = std::allocator<std::pair<const Key, T>>>
using Container::SequencialMap< Key, T, Compare, Allocator >::allocator_type = Allocator

Provide same member type of std::map.

◆ map_type

template<typename Key , typename T , typename Compare = std::less<Key>, typename Allocator = std::allocator<std::pair<const Key, T>>>
using Container::SequencialMap< Key, T, Compare, Allocator >::map_type = std::map<Key, T, Compare, Allocator>

Underlying map type for map APIs.

◆ vector_type

template<typename Key , typename T , typename Compare = std::less<Key>, typename Allocator = std::allocator<std::pair<const Key, T>>>
using Container::SequencialMap< Key, T, Compare, Allocator >::vector_type = std::vector<typename map_type::iterator>

Underlying map type for random-access operations and sequencial traversal.

◆ key_type

template<typename Key , typename T , typename Compare = std::less<Key>, typename Allocator = std::allocator<std::pair<const Key, T>>>
using Container::SequencialMap< Key, T, Compare, Allocator >::key_type = typename map_type::key_type

Provide same member type of std::map.

◆ mapped_type

template<typename Key , typename T , typename Compare = std::less<Key>, typename Allocator = std::allocator<std::pair<const Key, T>>>
using Container::SequencialMap< Key, T, Compare, Allocator >::mapped_type = typename map_type::mapped_type

Provide same member type of std::map.

◆ key_compare

template<typename Key , typename T , typename Compare = std::less<Key>, typename Allocator = std::allocator<std::pair<const Key, T>>>
using Container::SequencialMap< Key, T, Compare, Allocator >::key_compare = typename map_type::key_compare

Provide same member type of std::map.

◆ value_compare

template<typename Key , typename T , typename Compare = std::less<Key>, typename Allocator = std::allocator<std::pair<const Key, T>>>
using Container::SequencialMap< Key, T, Compare, Allocator >::value_compare = typename map_type::value_compare

Provide same member type of std::map.

◆ value_type

template<typename Key , typename T , typename Compare = std::less<Key>, typename Allocator = std::allocator<std::pair<const Key, T>>>
using Container::SequencialMap< Key, T, Compare, Allocator >::value_type = typename map_type::value_type

Provide same member type of std::map.

◆ pointer

template<typename Key , typename T , typename Compare = std::less<Key>, typename Allocator = std::allocator<std::pair<const Key, T>>>
using Container::SequencialMap< Key, T, Compare, Allocator >::pointer = typename map_type::pointer

Provide same member type of std::map.

◆ const_pointer

template<typename Key , typename T , typename Compare = std::less<Key>, typename Allocator = std::allocator<std::pair<const Key, T>>>
using Container::SequencialMap< Key, T, Compare, Allocator >::const_pointer = typename map_type::const_pointer

Provide same member type of std::map.

◆ reference

template<typename Key , typename T , typename Compare = std::less<Key>, typename Allocator = std::allocator<std::pair<const Key, T>>>
using Container::SequencialMap< Key, T, Compare, Allocator >::reference = typename map_type::reference

Provide same member type of std::map.

◆ const_reference

template<typename Key , typename T , typename Compare = std::less<Key>, typename Allocator = std::allocator<std::pair<const Key, T>>>
using Container::SequencialMap< Key, T, Compare, Allocator >::const_reference = typename map_type::const_reference

Provide same member type of std::map.

◆ size_type

template<typename Key , typename T , typename Compare = std::less<Key>, typename Allocator = std::allocator<std::pair<const Key, T>>>
using Container::SequencialMap< Key, T, Compare, Allocator >::size_type = typename map_type::size_type

Provide same member type of std::map.

◆ difference_type

template<typename Key , typename T , typename Compare = std::less<Key>, typename Allocator = std::allocator<std::pair<const Key, T>>>
using Container::SequencialMap< Key, T, Compare, Allocator >::difference_type = typename map_type::difference_type

Provide same member type of std::map.

◆ iterator

template<typename Key , typename T , typename Compare = std::less<Key>, typename Allocator = std::allocator<std::pair<const Key, T>>>
using Container::SequencialMap< Key, T, Compare, Allocator >::iterator = iterator_base<false>

Mutable iterator type for LegacyRandomAccessIterator.

◆ const_iterator

template<typename Key , typename T , typename Compare = std::less<Key>, typename Allocator = std::allocator<std::pair<const Key, T>>>
using Container::SequencialMap< Key, T, Compare, Allocator >::const_iterator = iterator_base<true>

Immutable iterator type for constant LegacyRandomAccessIterator.

◆ reverse_iterator

template<typename Key , typename T , typename Compare = std::less<Key>, typename Allocator = std::allocator<std::pair<const Key, T>>>
using Container::SequencialMap< Key, T, Compare, Allocator >::reverse_iterator = std::reverse_iterator<iterator>

Mutable reverse iterator type.

◆ const_reverse_iterator

template<typename Key , typename T , typename Compare = std::less<Key>, typename Allocator = std::allocator<std::pair<const Key, T>>>
using Container::SequencialMap< Key, T, Compare, Allocator >::const_reverse_iterator = std::reverse_iterator<const_iterator>

Immutable reverse iterator type.

◆ reverse_key_iterator

template<typename Key , typename T , typename Compare = std::less<Key>, typename Allocator = std::allocator<std::pair<const Key, T>>>
using Container::SequencialMap< Key, T, Compare, Allocator >::reverse_key_iterator = std::reverse_iterator<key_iterator>

Reverse iterator to traverse keys.

Constructor & Destructor Documentation

◆ SequencialMap() [1/7]

template<typename Key , typename T , typename Compare = std::less<Key>, typename Allocator = std::allocator<std::pair<const Key, T>>>
Container::SequencialMap< Key, T, Compare, Allocator >::SequencialMap ( )
inline

Default constructor, constructs an empty container.

◆ SequencialMap() [2/7]

template<typename Key , typename T , typename Compare = std::less<Key>, typename Allocator = std::allocator<std::pair<const Key, T>>>
Container::SequencialMap< Key, T, Compare, Allocator >::SequencialMap ( const Compare &  comp,
const Allocator &  alloc = Allocator() 
)
inlineexplicit

Constructs an empty container with given comparator and allocator.

Parameters
compComparison function object given for this container.
allocAllocator given for this container.

◆ SequencialMap() [3/7]

template<typename Key , typename T , typename Compare = std::less<Key>, typename Allocator = std::allocator<std::pair<const Key, T>>>
template<typename InputIt >
Container::SequencialMap< Key, T, Compare, Allocator >::SequencialMap ( InputIt  first,
InputIt  last,
const Compare &  comp = Compare(),
const Allocator &  alloc = Allocator() 
)
inline

Constructs the container with the contents of the range [first, last). If multiple elements in the range have keys that compare equivalent, only the first element is inserted.

Parameters
firstIterator to the first element to copy from.
lastIterator after the last element to copy from.
compComparison function object given for this container.
allocAllocator given for this container.

◆ SequencialMap() [4/7]

template<typename Key , typename T , typename Compare = std::less<Key>, typename Allocator = std::allocator<std::pair<const Key, T>>>
template<typename InputIt >
Container::SequencialMap< Key, T, Compare, Allocator >::SequencialMap ( InputIt  first,
InputIt  last,
const Allocator &  alloc 
)
inline

Constructs the container with the contents of the range [first, last). If multiple elements in the range have keys that compare equivalent, only the first element is inserted.

Parameters
firstIterator to the first element to copy from.
lastIterator after the last element to copy from.
allocAllocator given for this container.

◆ SequencialMap() [5/7]

template<typename Key , typename T , typename Compare = std::less<Key>, typename Allocator = std::allocator<std::pair<const Key, T>>>
Container::SequencialMap< Key, T, Compare, Allocator >::SequencialMap ( const SequencialMap< Key, T, Compare, Allocator > &  other,
const Allocator &  alloc = Allocator() 
)
inline

Copy constructor. Constructs the container with the copy of the contents of other. If alloc is not provided, allocator is obtained by calling ```cpp std::allocator_traits<allocator_type>::select_on_container_copy_construction(other.get_allocator()) ```.

Parameters
otherAnother container to be used as source to initialize the elements of the container with.
allocAllocator given for this container.

◆ SequencialMap() [6/7]

template<typename Key , typename T , typename Compare = std::less<Key>, typename Allocator = std::allocator<std::pair<const Key, T>>>
Container::SequencialMap< Key, T, Compare, Allocator >::SequencialMap ( SequencialMap< Key, T, Compare, Allocator > &&  other,
const Allocator &  alloc = Allocator() 
)
inline

Move constructor. Constructs the container with the contents of other using move semantics. If alloc is not provided, allocator is obtained by move-construction from the allocator belonging to other.

Parameters
otherAnother container to be used as source to initialize the elements of the container with.
allocAllocator given for this container.

◆ SequencialMap() [7/7]

template<typename Key , typename T , typename Compare = std::less<Key>, typename Allocator = std::allocator<std::pair<const Key, T>>>
Container::SequencialMap< Key, T, Compare, Allocator >::SequencialMap ( std::initializer_list< value_type init,
const Compare &  comp = Compare(),
const Allocator &  alloc = Allocator() 
)
inline

Constructs the container with the contents of the initializer list init. If multiple elements in the range have keys that compare equivalent, only the first element is inserted.

Parameters
initInitializer list with value_type elements.
compComparison function object given for this container.
allocAllocator given for this container.

◆ ~SequencialMap()

template<typename Key , typename T , typename Compare = std::less<Key>, typename Allocator = std::allocator<std::pair<const Key, T>>>
Container::SequencialMap< Key, T, Compare, Allocator >::~SequencialMap ( )
default

Destructs the container. The destructors of the elements are called and the used storage is deallocated. Note, that if the elements are pointers, the pointed-to objects are not destroyed.

Member Function Documentation

◆ get_allocator()

template<typename Key , typename T , typename Compare = std::less<Key>, typename Allocator = std::allocator<std::pair<const Key, T>>>
allocator_type Container::SequencialMap< Key, T, Compare, Allocator >::get_allocator ( ) const
inline

Returns the allocator associated with the container.

Returns
The associated allocator.

◆ empty()

template<typename Key , typename T , typename Compare = std::less<Key>, typename Allocator = std::allocator<std::pair<const Key, T>>>
bool Container::SequencialMap< Key, T, Compare, Allocator >::empty ( ) const
inlinenoexcept

Checks if the container has no elements, i.e. whether begin() == end().

Returns
true if the container is empty, false otherwise.

Complexity
Constant.

◆ size()

template<typename Key , typename T , typename Compare = std::less<Key>, typename Allocator = std::allocator<std::pair<const Key, T>>>
size_type Container::SequencialMap< Key, T, Compare, Allocator >::size ( ) const
inlinenoexcept

Returns the number of elements in the container, i.e. std::distance(begin(), end()).

Returns
The number of elements in the container.

Complexity
Constant.

◆ max_size()

template<typename Key , typename T , typename Compare = std::less<Key>, typename Allocator = std::allocator<std::pair<const Key, T>>>
size_type Container::SequencialMap< Key, T, Compare, Allocator >::max_size ( ) const
inlinenoexcept

Returns the maximum number of elements the container is able to hold due to system or library implementation limitations, i.e. std::distance(begin(), end()) for the largest container.

Returns
Maximum number of elements.

This value typically reflects the theoretical limit on the size of the container, at most std::numeric_limits<difference_type>::max(). At runtime, the size of the container may be limited to a value smaller than max_size() by the amount of RAM available.
Complexity
Constant.

◆ clear()

template<typename Key , typename T , typename Compare = std::less<Key>, typename Allocator = std::allocator<std::pair<const Key, T>>>
void Container::SequencialMap< Key, T, Compare, Allocator >::clear ( )
inlinenoexcept

@brief Erases all elements from the container. After this call, size() returns zero.

Invalidates any references, pointers, or iterators referring to contained elements. Any past-the-end iterator remains valid.

Complexity
Linear in the size of the container, i.e., the number of elements.

◆ contains()

template<typename Key , typename T , typename Compare = std::less<Key>, typename Allocator = std::allocator<std::pair<const Key, T>>>
bool Container::SequencialMap< Key, T, Compare, Allocator >::contains ( const key_type key) const
inline

Checks if there is an element with key equivalent to key in the container.

Parameters
keyKey value of the element to search for.
Returns
true if there is such an element, otherwise false.

Complexity
Logarithmic in the size of the container.

◆ find() [1/2]

template<typename Key , typename T , typename Compare = std::less<Key>, typename Allocator = std::allocator<std::pair<const Key, T>>>
iterator Container::SequencialMap< Key, T, Compare, Allocator >::find ( const key_type key)
inline

Finds an element with key equivalent to key.

Parameters
keyKey value of the element to search for.
Returns
Iterator to an element with key equivalent to key. If no such element is found, past-the-end (see end()) iterator is returned.

Complexity
Logarithmic in the size of the container.

◆ find() [2/2]

template<typename Key , typename T , typename Compare = std::less<Key>, typename Allocator = std::allocator<std::pair<const Key, T>>>
const_iterator Container::SequencialMap< Key, T, Compare, Allocator >::find ( const key_type key) const
inline

Finds an element with key equivalent to key.

Parameters
keyKey value of the element to search for.
Returns
Iterator to an element with key equivalent to key. If no such element is found, past-the-end (see end()) iterator is returned.

Complexity
Logarithmic in the size of the container.

◆ keys()

template<typename Key , typename T , typename Compare = std::less<Key>, typename Allocator = std::allocator<std::pair<const Key, T>>>
template<typename Container = std::vector<key_type>>
Container Container::SequencialMap< Key, T, Compare, Allocator >::keys ( ) const
inline

Returns a list containing all the keys in the map in the sequence order of value appends.

Template Parameters
ContainerVector-like container to contain return keys.
Returns
List containing all the keys in the map in the sequence order of value appends.

The order is guaranteed to be the same as that used by values().

Complexity
Linear in the size of the container, i.e., the number of elements.

See also
values, key

◆ key()

template<typename Key , typename T , typename Compare = std::less<Key>, typename Allocator = std::allocator<std::pair<const Key, T>>>
const key_type Container::SequencialMap< Key, T, Compare, Allocator >::key ( const T &  value,
const key_type defaultKey = key_type() 
) const
inline

Returns the key with value value, or defaultKey if the map contains no item with value value.

Parameters
valueValue to find key from.
defaultKeyDefault return if the map contains no item with value value.
Returns
The key with value value, or defaultKey if the map contains no item with value value.

This function can be slow(linear time), because its internal data structure is optimized for fast lookup by key, not by value.
Complexity
Linear in the size of the container, i.e., the number of elements.

◆ values()

template<typename Key , typename T , typename Compare = std::less<Key>, typename Allocator = std::allocator<std::pair<const Key, T>>>
template<typename Container = std::vector<T>>
Container Container::SequencialMap< Key, T, Compare, Allocator >::values ( ) const
inline

Returns a list containing all the values in the map in the sequence order of value appends.

Template Parameters
ContainerVector-like container to contain return values.
Returns
List containing all the values in the map in the sequence order of value appends.

The order is guaranteed to be the same as that used by values().

Complexity
Linear in the size of the container, i.e., the number of elements.

See also
keys, value

◆ value()

template<typename Key , typename T , typename Compare = std::less<Key>, typename Allocator = std::allocator<std::pair<const Key, T>>>
const T & Container::SequencialMap< Key, T, Compare, Allocator >::value ( const key_type key,
const T &  defaultValue = T() 
) const
inline

Returns the value associated with the key key.

Parameters
keyKey to find value from.
defaultValueDefault return value if the map contains no item with key key.
Returns
The key with value value, or defaultKey if the map contains no item with value value.

If the map contains no item with key key, the function returns defaultValue.

Complexity
Logarithmic in the size of the container.

◆ at() [1/2]

template<typename Key , typename T , typename Compare = std::less<Key>, typename Allocator = std::allocator<std::pair<const Key, T>>>
reference Container::SequencialMap< Key, T, Compare, Allocator >::at ( size_type  pos)
inline

Returns a reference to the element at specified location pos, with bounds checking.

Parameters
posPosition of the element to return
Returns
Reference to the requested element.
Exceptions
std::out_of_rangeIf pos is not within the range of the container, i.e. if !(pos < size()), an exception of type std::out_of_range is thrown.

Complexity
Constant.

◆ at() [2/2]

template<typename Key , typename T , typename Compare = std::less<Key>, typename Allocator = std::allocator<std::pair<const Key, T>>>
const_reference Container::SequencialMap< Key, T, Compare, Allocator >::at ( size_type  pos) const
inline

Returns a const reference to the element at specified location pos, with bounds checking.

Parameters
posPosition of the element to return
Returns
Const reference to the requested element.
Exceptions
std::out_of_rangeIf pos is not within the range of the container, i.e. if !(pos < size()), an exception of type std::out_of_range is thrown.

Complexity
Constant.

◆ operator[]() [1/4]

template<typename Key , typename T , typename Compare = std::less<Key>, typename Allocator = std::allocator<std::pair<const Key, T>>>
T & Container::SequencialMap< Key, T, Compare, Allocator >::operator[] ( const key_type key)
inline

Returns a reference to the value that is mapped to a key equivalent to key, performing an insertion if such key does not already exist.

Parameters
keyThe key of the element to find.
Returns
Reference to the mapped value of the new element if no element with key key existed. Otherwise a reference to the mapped value of the existing element whose key is equivalent to key.

Complexity
Logarithmic in the size of the container.

◆ operator[]() [2/4]

template<typename Key , typename T , typename Compare = std::less<Key>, typename Allocator = std::allocator<std::pair<const Key, T>>>
T & Container::SequencialMap< Key, T, Compare, Allocator >::operator[] ( key_type &&  key)
inline

Returns a reference to the value that is mapped to a key equivalent to key, performing an insertion if such key does not already exist.

Parameters
keyThe key of the element to find.
Returns
Reference to the mapped value of the new element if no element with key key existed. Otherwise a reference to the mapped value of the existing element whose key is equivalent to key.

Complexity
Logarithmic in the size of the container.

◆ operator[]() [3/4]

template<typename Key , typename T , typename Compare = std::less<Key>, typename Allocator = std::allocator<std::pair<const Key, T>>>
const T Container::SequencialMap< Key, T, Compare, Allocator >::operator[] ( const key_type key) const
inline

Returns a copy to the value that is mapped to a key equivalent to key, return a default constructed value if such key does not already exist.

Parameters
keyThe key of the element to find.
Returns
Copy to the mapped value of if element with key key existed. Otherwise a default constructed value is returned.

Complexity
Logarithmic in the size of the container.

◆ operator[]() [4/4]

template<typename Key , typename T , typename Compare = std::less<Key>, typename Allocator = std::allocator<std::pair<const Key, T>>>
const T Container::SequencialMap< Key, T, Compare, Allocator >::operator[] ( key_type &&  key) const
inline

Returns a copy to the value that is mapped to a key equivalent to key, return a default constructed value if such key does not already exist.

Parameters
keyThe key of the element to find.
Returns
Copy to the mapped value of if element with key key existed. Otherwise a default constructed value is returned.

Complexity
Logarithmic in the size of the container.

◆ front() [1/2]

template<typename Key , typename T , typename Compare = std::less<Key>, typename Allocator = std::allocator<std::pair<const Key, T>>>
reference Container::SequencialMap< Key, T, Compare, Allocator >::front ( )
inline

Returns a reference to the first element in the container.

Returns
Reference to the first element.
Warning
Calling front on an empty container is undefined.

Complexity
Constant.

◆ front() [2/2]

template<typename Key , typename T , typename Compare = std::less<Key>, typename Allocator = std::allocator<std::pair<const Key, T>>>
const_reference Container::SequencialMap< Key, T, Compare, Allocator >::front ( ) const
inline

Returns a const reference to the first element in the container.

Returns
Const reference to the first element.
Warning
Calling front on an empty container is undefined.

Complexity
Constant.

◆ back() [1/2]

template<typename Key , typename T , typename Compare = std::less<Key>, typename Allocator = std::allocator<std::pair<const Key, T>>>
reference Container::SequencialMap< Key, T, Compare, Allocator >::back ( )
inline

Returns a reference to the last element in the container.

Returns
Reference to the last element.
Warning
Calling front on an empty container is undefined.

Complexity
Constant.

◆ back() [2/2]

template<typename Key , typename T , typename Compare = std::less<Key>, typename Allocator = std::allocator<std::pair<const Key, T>>>
const_reference Container::SequencialMap< Key, T, Compare, Allocator >::back ( ) const
inline

Returns a const reference to the last element in the container.

Returns
Const reference to the last element.
Warning
Calling front on an empty container is undefined.

Complexity
Constant.

◆ mid() [1/2]

template<typename Key , typename T , typename Compare = std::less<Key>, typename Allocator = std::allocator<std::pair<const Key, T>>>
SequencialMap Container::SequencialMap< Key, T, Compare, Allocator >::mid ( size_type  pos) const
inline

Returns a sub-map which contains elements from this map, starting at position pos to the end.

Parameters
posFirst element position.
Returns
Sub-map contains all elements starting from position pos.

Complexity
Linear in the size of the return container, i.e., the number of elements starting from pos.

◆ mid() [2/2]

template<typename Key , typename T , typename Compare = std::less<Key>, typename Allocator = std::allocator<std::pair<const Key, T>>>
SequencialMap Container::SequencialMap< Key, T, Compare, Allocator >::mid ( size_type  pos,
size_type  length 
) const
inline

Returns a sub-map which contains elements from this map, starting at position pos, with length elements (or all remaining elements if there are less than length elements) are included.

Parameters
posFirst element position.
lengthElements numbers from pos to be included.
Returns
Sub-map contains length elements starting at position pos.

Complexity
Linear in the size of the return container, i.e., the number of length.

◆ push_back() [1/7]

template<typename Key , typename T , typename Compare = std::less<Key>, typename Allocator = std::allocator<std::pair<const Key, T>>>
std::pair< iterator, bool > Container::SequencialMap< Key, T, Compare, Allocator >::push_back ( const_reference  value)
inline

Appends the given element value to the end of the container, if the container doesn't already contain an element with an equivalent key.

Parameters
valueThe element to append.
Returns
Returns a pair consisting of an iterator to the inserted element (or to the element that prevented the insertion) and a bool denoting whether the insertion took place.

Complexity
Logarithmic in the size of the container.

◆ push_back() [2/7]

template<typename Key , typename T , typename Compare = std::less<Key>, typename Allocator = std::allocator<std::pair<const Key, T>>>
std::pair< iterator, bool > Container::SequencialMap< Key, T, Compare, Allocator >::push_back ( value_type &&  value)
inline

Appends the given element value to the end of the container, if the container doesn't already contain an element with an equivalent key.

Parameters
valueThe element to append.
Returns
Returns a pair consisting of an iterator to the inserted element (or to the element that prevented the insertion) and a bool denoting whether the insertion took place.

Complexity
Logarithmic in the size of the container.

◆ push_back() [3/7]

template<typename Key , typename T , typename Compare = std::less<Key>, typename Allocator = std::allocator<std::pair<const Key, T>>>
std::pair< iterator, bool > Container::SequencialMap< Key, T, Compare, Allocator >::push_back ( const key_type key,
const T &  value 
)
inline

Appends the given element value to the end of the container, if the container doesn't already contain an element with an equivalent key.

Parameters
keyThe key of the element to append.
valueThe value of the element to append.
Returns
Returns a pair consisting of an iterator to the inserted element (or to the element that prevented the insertion) and a bool denoting whether the insertion took place.

Complexity
Logarithmic in the size of the container.

◆ push_back() [4/7]

template<typename Key , typename T , typename Compare = std::less<Key>, typename Allocator = std::allocator<std::pair<const Key, T>>>
std::pair< iterator, bool > Container::SequencialMap< Key, T, Compare, Allocator >::push_back ( const key_type key,
T &&  value 
)
inline

Appends the given element value to the end of the container, if the container doesn't already contain an element with an equivalent key.

Parameters
keyThe key of the element to append.
valueThe value of the element to append.
Returns
Returns a pair consisting of an iterator to the inserted element (or to the element that prevented the insertion) and a bool denoting whether the insertion took place.

Complexity
Logarithmic in the size of the container.

◆ push_back() [5/7]

template<typename Key , typename T , typename Compare = std::less<Key>, typename Allocator = std::allocator<std::pair<const Key, T>>>
void Container::SequencialMap< Key, T, Compare, Allocator >::push_back ( const SequencialMap< Key, T, Compare, Allocator > &  other)
inline

Appends all elements from given container other to the end of the container, ignores all values with keys already exists in the container.

Parameters
otherAnother container to append all elements from.

Complexity
O(N*log(size() + N)), where N is the number of elements to insert.

◆ push_back() [6/7]

template<typename Key , typename T , typename Compare = std::less<Key>, typename Allocator = std::allocator<std::pair<const Key, T>>>
void Container::SequencialMap< Key, T, Compare, Allocator >::push_back ( std::initializer_list< value_type ilist)
inline

Appends all elements from initializer list ilist to the end of the container, ignores all values with keys already exists in the container.

Parameters
otherInitializer list to append all elements from.

Complexity
O(N*log(size() + N)), where N is the number of elements to insert.

◆ push_back() [7/7]

template<typename Key , typename T , typename Compare = std::less<Key>, typename Allocator = std::allocator<std::pair<const Key, T>>>
template<typename InputIt >
void Container::SequencialMap< Key, T, Compare, Allocator >::push_back ( InputIt  first,
InputIt  last 
)
inline

Appends all elements from from range [first, last) to the end of the container, ignores all values with keys already exists in the container.

Parameters
firstIterator to the first element to append from.
lastIterator after the last element to append from.

Complexity
O(N*log(size() + N)), where N is the number of elements to insert.

◆ emplace_back() [1/2]

template<typename Key , typename T , typename Compare = std::less<Key>, typename Allocator = std::allocator<std::pair<const Key, T>>>
template<typename... Args>
std::pair< iterator, bool > Container::SequencialMap< Key, T, Compare, Allocator >::emplace_back ( const key_type key,
Args &&...  args 
)
inline

Appends a new element to the end of the container.

Template Parameters
ArgsArguments to forward to the constructor of the element.
Parameters
keyThe key of the element to append.
argsArguments to forward to the constructor of value.
Returns
Returns a pair consisting of an iterator to the inserted element (or to the element that prevented the insertion) and a bool denoting whether the insertion took place.

The element is constructed through std::allocator_traits::construct, which typically uses placement-new to construct the element in-place at the location provided by the container. The arguments args... are forwarded to the constructor as std::forward<Args>(args)....

Complexity
Logarithmic in the size of the container.

◆ emplace_back() [2/2]

template<typename Key , typename T , typename Compare = std::less<Key>, typename Allocator = std::allocator<std::pair<const Key, T>>>
template<typename... Args>
std::pair< iterator, bool > Container::SequencialMap< Key, T, Compare, Allocator >::emplace_back ( key_type &&  key,
Args &&...  args 
)
inline

Appends a new element to the end of the container.

Template Parameters
ArgsArguments to forward to the constructor of the element.
Parameters
keyThe key of the element to append.
argsArguments to forward to the constructor of value.
Returns
Returns a pair consisting of an iterator to the inserted element (or to the element that prevented the insertion) and a bool denoting whether the insertion took place.

The element is constructed through std::allocator_traits::construct, which typically uses placement-new to construct the element in-place at the location provided by the container. The arguments args... are forwarded to the constructor as std::forward<Args>(args)....

Complexity
Logarithmic in the size of the container.

◆ operator+() [1/2]

template<typename Key , typename T , typename Compare = std::less<Key>, typename Allocator = std::allocator<std::pair<const Key, T>>>
SequencialMap Container::SequencialMap< Key, T, Compare, Allocator >::operator+ ( const SequencialMap< Key, T, Compare, Allocator > &  other) const
inline

Same as push_back, appends all elements from given container other to the end of the container, ignores all values with keys already exists in the container.

Parameters
otherAnother container to append all elements from.

Complexity
O(N*log(size() + N)), where N is the number of elements to insert.

◆ operator+() [2/2]

template<typename Key , typename T , typename Compare = std::less<Key>, typename Allocator = std::allocator<std::pair<const Key, T>>>
SequencialMap Container::SequencialMap< Key, T, Compare, Allocator >::operator+ ( SequencialMap< Key, T, Compare, Allocator > &&  other) const
inline

Same as push_back, appends all elements from given container other to the end of the container, ignores all values with keys already exists in the container.

Parameters
otherAnother container to append all elements from.

Complexity
O(N*log(size() + N)), where N is the number of elements to insert.

◆ operator+=() [1/2]

template<typename Key , typename T , typename Compare = std::less<Key>, typename Allocator = std::allocator<std::pair<const Key, T>>>
SequencialMap & Container::SequencialMap< Key, T, Compare, Allocator >::operator+= ( const SequencialMap< Key, T, Compare, Allocator > &  other)
inline

Same as push_back, appends all elements from given container other to the end of the container and return *this, ignores all values with keys already exists in the container.

Parameters
otherAnother container to append all elements from.
Returns
*this after appends.

Complexity
O(N*log(size() + N)), where N is the number of elements to insert.

◆ operator+=() [2/2]

template<typename Key , typename T , typename Compare = std::less<Key>, typename Allocator = std::allocator<std::pair<const Key, T>>>
SequencialMap & Container::SequencialMap< Key, T, Compare, Allocator >::operator+= ( SequencialMap< Key, T, Compare, Allocator > &&  other)
inline

Same as push_back, appends all elements from given container other to the end of the container and return *this, ignores all values with keys already exists in the container.

Parameters
otherAnother container to append all elements from.
Returns
*this after appends.

Complexity
O(N*log(size() + N)), where N is the number of elements to insert.

◆ insert() [1/12]

template<typename Key , typename T , typename Compare = std::less<Key>, typename Allocator = std::allocator<std::pair<const Key, T>>>
iterator Container::SequencialMap< Key, T, Compare, Allocator >::insert ( size_t  pos,
const_reference  value 
)
inline

Inserts element into the container, if the container doesn't already contain an element with an equivalent key.

Parameters
posIndex to the position before which the new element will be inserted.
valueElement to insert.
Returns
An iterator to the inserted element, or to the element that prevented the insertion.

Complexity
Linear in the size of the container, i.e., the number of elements.

◆ insert() [2/12]

template<typename Key , typename T , typename Compare = std::less<Key>, typename Allocator = std::allocator<std::pair<const Key, T>>>
iterator Container::SequencialMap< Key, T, Compare, Allocator >::insert ( size_t  pos,
value_type &&  value 
)
inline

Inserts element into the container, if the container doesn't already contain an element with an equivalent key.

Parameters
posIndex to the position before which the new element will be inserted.
valueElement to insert.
Returns
An iterator to the inserted element, or to the element that prevented the insertion.

Complexity
Linear in the size of the container, i.e., the number of elements.
Much faster than raw std::vector, because moved values are std::map::iterator, not acture T node.

◆ insert() [3/12]

template<typename Key , typename T , typename Compare = std::less<Key>, typename Allocator = std::allocator<std::pair<const Key, T>>>
iterator Container::SequencialMap< Key, T, Compare, Allocator >::insert ( size_t  pos,
const key_type key,
const T &  value 
)
inline

Inserts element into the container, if the container doesn't already contain an element with an equivalent key.

Parameters
posIndex to the position before which the new element will be inserted.
keyKey of element to insert.
valueValue of element to insert.
Returns
An iterator to the inserted element, or to the element that prevented the insertion.

Complexity
Linear in the size of the container, i.e., the number of elements.
Much faster than raw std::vector, because moved values are std::map::iterator, not acture T node.

◆ insert() [4/12]

template<typename Key , typename T , typename Compare = std::less<Key>, typename Allocator = std::allocator<std::pair<const Key, T>>>
iterator Container::SequencialMap< Key, T, Compare, Allocator >::insert ( size_t  pos,
const key_type key,
T &&  value 
)
inline

Inserts element into the container, if the container doesn't already contain an element with an equivalent key.

Parameters
posIndex to the position before which the new element will be inserted.
keyKey of element to insert.
valueValue of element to insert.
Returns
An iterator to the inserted element, or to the element that prevented the insertion.

Complexity
Linear in the size of the container, i.e., the number of elements.
Much faster than raw std::vector, because moved values are std::map::iterator, not acture T node.

◆ insert() [5/12]

template<typename Key , typename T , typename Compare = std::less<Key>, typename Allocator = std::allocator<std::pair<const Key, T>>>
iterator Container::SequencialMap< Key, T, Compare, Allocator >::insert ( iterator  pos,
const_reference  value 
)
inline

Inserts element into the container, if the container doesn't already contain an element with an equivalent key.

Parameters
posIterator to the position before which the new element will be inserted.
valueElement to insert.
Returns
An iterator to the inserted element, or to the element that prevented the insertion.

Complexity
Linear in the size of the container, i.e., the number of elements.
Much faster than raw std::vector, because moved values are std::map::iterator, not acture T node.

◆ insert() [6/12]

template<typename Key , typename T , typename Compare = std::less<Key>, typename Allocator = std::allocator<std::pair<const Key, T>>>
iterator Container::SequencialMap< Key, T, Compare, Allocator >::insert ( iterator  pos,
value_type &&  value 
)
inline

Inserts element into the container, if the container doesn't already contain an element with an equivalent key.

Parameters
posIterator to the position before which the new element will be inserted.
valueElement to insert.
Returns
An iterator to the inserted element, or to the element that prevented the insertion.

Complexity
Linear in the size of the container, i.e., the number of elements.
Much faster than raw std::vector, because moved values are std::map::iterator, not acture T node.

◆ insert() [7/12]

template<typename Key , typename T , typename Compare = std::less<Key>, typename Allocator = std::allocator<std::pair<const Key, T>>>
iterator Container::SequencialMap< Key, T, Compare, Allocator >::insert ( iterator  pos,
const key_type key,
const T &  value 
)
inline

Inserts element into the container, if the container doesn't already contain an element with an equivalent key.

Parameters
posIterator to the position before which the new element will be inserted.
keyKey of element to insert.
valueValue of element to insert.
Returns
An iterator to the inserted element, or to the element that prevented the insertion.

Complexity
Linear in the size of the container, i.e., the number of elements.
Much faster than raw std::vector, because moved values are std::map::iterator, not acture T node.

◆ insert() [8/12]

template<typename Key , typename T , typename Compare = std::less<Key>, typename Allocator = std::allocator<std::pair<const Key, T>>>
iterator Container::SequencialMap< Key, T, Compare, Allocator >::insert ( iterator  pos,
const key_type key,
T &&  value 
)
inline

Inserts element into the container, if the container doesn't already contain an element with an equivalent key.

Parameters
posIterator to the position before which the new element will be inserted.
keyKey of element to insert.
valueValue of element to insert.
Returns
An iterator to the inserted element, or to the element that prevented the insertion.

Complexity
Linear in the size of the container, i.e., the number of elements.
Much faster than raw std::vector, because moved values are std::map::iterator, not acture T node.

◆ insert() [9/12]

template<typename Key , typename T , typename Compare = std::less<Key>, typename Allocator = std::allocator<std::pair<const Key, T>>>
template<typename InputIt >
void Container::SequencialMap< Key, T, Compare, Allocator >::insert ( size_t  pos,
InputIt  first,
InputIt  last 
)
inline

Inserts elements into the container, if the container doesn't already contain an element with an equivalent key.

Template Parameters
InputItMust meet the requirements of LegacyInputIterator.
Parameters
posIndex to the position before which the new element will be inserted.
firstIterator to the first element to insert.
lastIterator after the last element to insert.

Complexity
O(N*log(size() + N)), where N is the number of elements to insert.
Much faster than raw std::vector, because moved values are std::map::iterator, not acture T node.

◆ insert() [10/12]

template<typename Key , typename T , typename Compare = std::less<Key>, typename Allocator = std::allocator<std::pair<const Key, T>>>
void Container::SequencialMap< Key, T, Compare, Allocator >::insert ( size_t  pos,
std::initializer_list< value_type ilist 
)
inline

Inserts elements into the container, if the container doesn't already contain an element with an equivalent key.

Parameters
posIndex to the position before which the new element will be inserted.
ilistInitializer list to insert the values from.

Complexity
O(N*log(size() + N)), where N is the number of elements to insert.
Much faster than raw std::vector, because moved values are std::map::iterator, not acture T node.

◆ insert() [11/12]

template<typename Key , typename T , typename Compare = std::less<Key>, typename Allocator = std::allocator<std::pair<const Key, T>>>
template<typename InputIt >
void Container::SequencialMap< Key, T, Compare, Allocator >::insert ( iterator  pos,
InputIt  first,
InputIt  last 
)
inline

Inserts elements into the container, if the container doesn't already contain an element with an equivalent key.

Template Parameters
InputItMust meet the requirements of LegacyInputIterator.
Parameters
posIterator to the position before which the new element will be inserted.
firstIterator to the first element to insert.
lastIterator after the last element to insert.

Complexity
O(N*log(size() + N)), where N is the number of elements to insert.
Much faster than raw std::vector, because moved values are std::map::iterator, not acture T node.

◆ insert() [12/12]

template<typename Key , typename T , typename Compare = std::less<Key>, typename Allocator = std::allocator<std::pair<const Key, T>>>
void Container::SequencialMap< Key, T, Compare, Allocator >::insert ( iterator  pos,
std::initializer_list< value_type ilist 
)
inline

Inserts elements into the container, if the container doesn't already contain an element with an equivalent key.

Parameters
posIterator to the position before which the new element will be inserted.
ilistInitializer list to insert the values from.

Complexity
O(N*log(size() + N)), where N is the number of elements to insert.
Much faster than raw std::vector, because moved values are std::map::iterator, not acture T node.

◆ emplace_at() [1/2]

template<typename Key , typename T , typename Compare = std::less<Key>, typename Allocator = std::allocator<std::pair<const Key, T>>>
template<typename... Args>
std::pair< iterator, bool > Container::SequencialMap< Key, T, Compare, Allocator >::emplace_at ( size_t  pos,
const key_type key,
Args &&...  args 
)
inline

Inserts a new element to the container as close as possible to the position just before hint. The element is constructed in-place, i.e. no copy or move operations are performed.

Template Parameters
Args
Parameters
posIndex to the position before which the new element will be inserted.
keyKey of element to insert.
argsArguments to forward to the constructor of the value.
Returns
Returns an iterator to the newly inserted element.
If the insertion failed because the element already exists, returns an iterator to the already existing element with the equivalent key.

The constructor of the value type (T) is called with exactly the same arguments as supplied to the function, forwarded with std::forward<Args>(args)....
Invalidates iterators after pos.
No references are invalidated.

Complexity
Linear in the size of the container, i.e., the number of elements.
Much faster than raw std::vector, because moved values are std::map::iterator, not acture T node.

◆ emplace_at() [2/2]

template<typename Key , typename T , typename Compare = std::less<Key>, typename Allocator = std::allocator<std::pair<const Key, T>>>
template<typename... Args>
std::pair< iterator, bool > Container::SequencialMap< Key, T, Compare, Allocator >::emplace_at ( size_t  pos,
key_type &&  key,
Args &&...  args 
)
inline

Inserts a new element to the container as close as possible to the position just before hint. The element is constructed in-place, i.e. no copy or move operations are performed.

Template Parameters
Args
Parameters
posIndex to the position before which the new element will be inserted.
keyKey of element to insert.
argsArguments to forward to the constructor of the value.
Returns
Returns an iterator to the newly inserted element.
If the insertion failed because the element already exists, returns an iterator to the already existing element with the equivalent key.

The constructor of the value type (T) is called with exactly the same arguments as supplied to the function, forwarded with std::forward<Args>(args)....
Invalidates iterators after pos.
No references are invalidated.

Complexity
Linear in the size of the container, i.e., the number of elements.
Much faster than raw std::vector, because moved values are std::map::iterator, not acture T node.

◆ emplace_hint()

template<typename Key , typename T , typename Compare = std::less<Key>, typename Allocator = std::allocator<std::pair<const Key, T>>>
template<typename... Args>
iterator Container::SequencialMap< Key, T, Compare, Allocator >::emplace_hint ( const_iterator  hint,
key_type &&  key,
Args &&...  args 
)
inline

Inserts a new element to the container as close as possible to the position just before hint. The element is constructed in-place, i.e. no copy or move operations are performed.

Template Parameters
Args
Parameters
posIterator to the position before which the new element will be inserted.
keyKey of element to insert.
argsArguments to forward to the constructor of the value.
Returns
Returns an iterator to the newly inserted element.
If the insertion failed because the element already exists, returns an iterator to the already existing element with the equivalent key.

The constructor of the value type (T) is called with exactly the same arguments as supplied to the function, forwarded with std::forward<Args>(args)....
Invalidates iterators after hint.
No references are invalidated.

Complexity
Linear in the size of the container, i.e., the number of elements.
Much faster than raw std::vector, because moved values are std::map::iterator, not acture T node.

◆ pop_back()

template<typename Key , typename T , typename Compare = std::less<Key>, typename Allocator = std::allocator<std::pair<const Key, T>>>
void Container::SequencialMap< Key, T, Compare, Allocator >::pop_back ( )
inline

Removes the last element of the container.

Calling pop_back on an empty container is undefined.
No iterators or references except for back() and end() are invalidated.

Complexity
Amortized constant.

◆ erase() [1/4]

template<typename Key , typename T , typename Compare = std::less<Key>, typename Allocator = std::allocator<std::pair<const Key, T>>>
void Container::SequencialMap< Key, T, Compare, Allocator >::erase ( const key_type key)
inline

Removes specified element from the container.

Parameters
keyKey of element to erase.

Invalidates reference to the erased element.
Invalidates iterators at or after the point of the erase.
Other references and iterators are not affected.

Complexity
Linear: the number of calls to the destructor of T is the same as the number of elements erased, the assignment operator of T is called the number of times equal to the number of elements in the vector after the erased elements.
Much faster than raw std::vector, because moved values are std::map::iterator, not acture T node.

◆ erase() [2/4]

template<typename Key , typename T , typename Compare = std::less<Key>, typename Allocator = std::allocator<std::pair<const Key, T>>>
void Container::SequencialMap< Key, T, Compare, Allocator >::erase ( size_type  pos,
size_type  count = 1 
)
inline

Removes specified elements from the container.

Parameters
posIndex to the position of the first element to erase.
countElements count to erase.

Invalidates references to the erased element.
Invalidates iterators at or after the eraseed elements.
Other references and iterators are not affected.

Complexity
Linear: the number of calls to the destructor of T is the same as the number of elements erased, the assignment operator of T is called the number of times equal to the number of elements in the vector after the erased elements.
Much faster than raw std::vector, because moved values are std::map::iterator, not acture T node.

◆ erase() [3/4]

template<typename Key , typename T , typename Compare = std::less<Key>, typename Allocator = std::allocator<std::pair<const Key, T>>>
iterator Container::SequencialMap< Key, T, Compare, Allocator >::erase ( const_iterator  pos)
inline

Removes specified elements from the container.

Parameters
keyKey of element to erase.
Returns
Iterator following the last removed element. If the iterator pos refers to the last element, the end() iterator is returned.

Invalidates reference to the erased element.
Invalidates iterators at or after the point of the erase.
Other references and iterators are not affected.

Complexity
Linear: the number of calls to the destructor of T is the same as the number of elements erased, the assignment operator of T is called the number of times equal to the number of elements in the vector after the erased elements.
Much faster than raw std::vector, because moved values are std::map::iterator, not acture T node.

◆ erase() [4/4]

template<typename Key , typename T , typename Compare = std::less<Key>, typename Allocator = std::allocator<std::pair<const Key, T>>>
iterator Container::SequencialMap< Key, T, Compare, Allocator >::erase ( const_iterator  first,
const_iterator  last 
)
inline

Removes specified elements from the container.

Parameters
firstIterator to the first element to erase.
lastIterator after the last element to erase.
Returns
Iterator following the last removed element. If the iterator pos refers to the last element, the end() iterator is returned.

Invalidates references to the erased element.
Invalidates iterators at or after the eraseed elements.
Other references and iterators are not affected.

Complexity
Linear: the number of calls to the destructor of T is the same as the number of elements erased, the assignment operator of T is called the number of times equal to the number of elements in the vector after the erased elements.
Much faster than raw std::vector, because moved values are std::map::iterator, not acture T node.

◆ begin() [1/2]

template<typename Key , typename T , typename Compare = std::less<Key>, typename Allocator = std::allocator<std::pair<const Key, T>>>
iterator Container::SequencialMap< Key, T, Compare, Allocator >::begin ( )
inline

Returns an iterator to the first element of the container.
If the container is empty, the returned iterator will be equal to end().

Returns
Iterator to the first element.

Complexity
Constant.

◆ begin() [2/2]

template<typename Key , typename T , typename Compare = std::less<Key>, typename Allocator = std::allocator<std::pair<const Key, T>>>
const_iterator Container::SequencialMap< Key, T, Compare, Allocator >::begin ( ) const
inline

Returns an iterator to the first element of the container.
If the container is empty, the returned iterator will be equal to end().

Returns
Iterator to the first element.

Complexity
Constant.

◆ cbegin()

template<typename Key , typename T , typename Compare = std::less<Key>, typename Allocator = std::allocator<std::pair<const Key, T>>>
const_iterator Container::SequencialMap< Key, T, Compare, Allocator >::cbegin ( ) const
inline

Returns an iterator to the first element of the container.
If the container is empty, the returned iterator will be equal to end().

Returns
Iterator to the first element.

Complexity
Constant.

◆ end() [1/2]

template<typename Key , typename T , typename Compare = std::less<Key>, typename Allocator = std::allocator<std::pair<const Key, T>>>
iterator Container::SequencialMap< Key, T, Compare, Allocator >::end ( )
inline

Returns an iterator to the element following the last element of the container.
This element acts as a placeholder; attempting to access it results in undefined behavior.

Returns
Iterator to the element following the last element.

Complexity
Constant.

◆ end() [2/2]

template<typename Key , typename T , typename Compare = std::less<Key>, typename Allocator = std::allocator<std::pair<const Key, T>>>
const_iterator Container::SequencialMap< Key, T, Compare, Allocator >::end ( ) const
inline

Returns an iterator to the element following the last element of the container.
This element acts as a placeholder; attempting to access it results in undefined behavior.

Returns
Iterator to the element following the last element.

Complexity
Constant.

◆ cend()

template<typename Key , typename T , typename Compare = std::less<Key>, typename Allocator = std::allocator<std::pair<const Key, T>>>
const_iterator Container::SequencialMap< Key, T, Compare, Allocator >::cend ( ) const
inline

Returns an iterator to the element following the last element of the container.
This element acts as a placeholder; attempting to access it results in undefined behavior.

Returns
Iterator to the element following the last element.

Complexity
Constant.

◆ rbegin() [1/2]

template<typename Key , typename T , typename Compare = std::less<Key>, typename Allocator = std::allocator<std::pair<const Key, T>>>
reverse_iterator Container::SequencialMap< Key, T, Compare, Allocator >::rbegin ( )
inline

Returns a reverse iterator to the first element of the reversed container. It corresponds to the last element of the non-reversed container. If the container is empty, the returned iterator is equal to rend().

Returns
Reverse iterator to the first element.

Complexity
Constant.

◆ rbegin() [2/2]

template<typename Key , typename T , typename Compare = std::less<Key>, typename Allocator = std::allocator<std::pair<const Key, T>>>
const_reverse_iterator Container::SequencialMap< Key, T, Compare, Allocator >::rbegin ( ) const
inline

Returns a reverse iterator to the first element of the reversed container. It corresponds to the last element of the non-reversed container. If the container is empty, the returned iterator is equal to rend().

Returns
Reverse iterator to the first element.

Complexity
Constant.

◆ crbegin()

template<typename Key , typename T , typename Compare = std::less<Key>, typename Allocator = std::allocator<std::pair<const Key, T>>>
const_reverse_iterator Container::SequencialMap< Key, T, Compare, Allocator >::crbegin ( ) const
inline

Returns a reverse iterator to the first element of the reversed container. It corresponds to the last element of the non-reversed container. If the container is empty, the returned iterator is equal to rend().

Returns
Reverse iterator to the first element.

Complexity
Constant.

◆ rend() [1/2]

template<typename Key , typename T , typename Compare = std::less<Key>, typename Allocator = std::allocator<std::pair<const Key, T>>>
reverse_iterator Container::SequencialMap< Key, T, Compare, Allocator >::rend ( )
inline

Returns a reverse iterator to the element following the last element of the reversed container. It corresponds to the element preceding the first element of the non-reversed container. This element acts as a placeholder, attempting to access it results in undefined behavior.

Returns
Reverse iterator to the element following the last element.

Complexity
Constant.

◆ rend() [2/2]

template<typename Key , typename T , typename Compare = std::less<Key>, typename Allocator = std::allocator<std::pair<const Key, T>>>
const_reverse_iterator Container::SequencialMap< Key, T, Compare, Allocator >::rend ( ) const
inline

Returns a reverse iterator to the element following the last element of the reversed container. It corresponds to the element preceding the first element of the non-reversed container. This element acts as a placeholder, attempting to access it results in undefined behavior.

Returns
Reverse iterator to the element following the last element.

Complexity
Constant.

◆ crend()

template<typename Key , typename T , typename Compare = std::less<Key>, typename Allocator = std::allocator<std::pair<const Key, T>>>
const_reverse_iterator Container::SequencialMap< Key, T, Compare, Allocator >::crend ( ) const
inline

Returns a reverse iterator to the element following the last element of the reversed container. It corresponds to the element preceding the first element of the non-reversed container. This element acts as a placeholder, attempting to access it results in undefined behavior.

Returns
Reverse iterator to the element following the last element.

Complexity
Constant.

◆ key_begin()

template<typename Key , typename T , typename Compare = std::less<Key>, typename Allocator = std::allocator<std::pair<const Key, T>>>
key_iterator Container::SequencialMap< Key, T, Compare, Allocator >::key_begin ( ) const
inline

Returns an iterator to the first key of the container.
If the container is empty, the returned iterator will be equal to end().

Returns
Iterator to the first key.

Complexity
Constant.

◆ key_end()

template<typename Key , typename T , typename Compare = std::less<Key>, typename Allocator = std::allocator<std::pair<const Key, T>>>
key_iterator Container::SequencialMap< Key, T, Compare, Allocator >::key_end ( ) const
inline

Returns an iterator to the key following the last key of the container.
This key acts as a placeholder; attempting to access it results in undefined behavior.

Returns
Iterator to the key following the last key.

Complexity
Constant.

◆ key_rbegin()

template<typename Key , typename T , typename Compare = std::less<Key>, typename Allocator = std::allocator<std::pair<const Key, T>>>
reverse_key_iterator Container::SequencialMap< Key, T, Compare, Allocator >::key_rbegin ( ) const
inline

Returns a reverse iterator to the first key of the reversed container. It corresponds to the last key of the non-reversed container. If the container is empty, the returned iterator is equal to rend().

Returns
Reverse iterator to the first key.

Complexity
Constant.

◆ key_rend()

template<typename Key , typename T , typename Compare = std::less<Key>, typename Allocator = std::allocator<std::pair<const Key, T>>>
reverse_key_iterator Container::SequencialMap< Key, T, Compare, Allocator >::key_rend ( ) const
inline

Returns a reverse iterator to the key following the last key of the reversed container. It corresponds to the key preceding the first key of the non-reversed container. This key acts as a placeholder, attempting to access it results in undefined behavior.

Returns
Reverse iterator to the key following the last key.

Complexity
Constant.

◆ operator=() [1/3]

template<typename Key , typename T , typename Compare = std::less<Key>, typename Allocator = std::allocator<std::pair<const Key, T>>>
SequencialMap & Container::SequencialMap< Key, T, Compare, Allocator >::operator= ( const SequencialMap< Key, T, Compare, Allocator > &  other)
inline

Replaces the contents of the input container.

Parameters
otherAnother container to use as data source
Returns
*this.

Complexity
Linear in the size of *this and other.

◆ operator=() [2/3]

template<typename Key , typename T , typename Compare = std::less<Key>, typename Allocator = std::allocator<std::pair<const Key, T>>>
SequencialMap & Container::SequencialMap< Key, T, Compare, Allocator >::operator= ( SequencialMap< Key, T, Compare, Allocator > &&  other)
inline

Replaces the contents of the input container.

Parameters
otherAnother container to use as data source
Returns
*this.

Complexity
Linear in the size of *this unless the allocators do not compare equal and do not propagate, in which case linear in the size of *this and other.

◆ operator=() [3/3]

template<typename Key , typename T , typename Compare = std::less<Key>, typename Allocator = std::allocator<std::pair<const Key, T>>>
SequencialMap & Container::SequencialMap< Key, T, Compare, Allocator >::operator= ( std::initializer_list< value_type ilist)
inline

Replaces the contents of the input container.

Parameters
IlistInitializer list to use as data source.
Returns
*this.

Complexity
O(NlogN) in general, where N is size() + ilist.size(). Linear if ilist is sorted with respect to value_comp().

◆ operator==()

template<typename Key , typename T , typename Compare = std::less<Key>, typename Allocator = std::allocator<std::pair<const Key, T>>>
bool Container::SequencialMap< Key, T, Compare, Allocator >::operator== ( const SequencialMap< Key, T, Compare, Allocator > &  other) const
inline

Checks if the contents of two containers are not equal.

Parameters
otherAnother container whose contents to compare.
Returns
true if the contents of the containers are equal, false otherwise.

Equal means that they have the same number of elements and each element in this compares equal with the element in other at the same position.
Complexity
Constant if containers are of different size, otherwise linear in the size of the container.

◆ operator!=()

template<typename Key , typename T , typename Compare = std::less<Key>, typename Allocator = std::allocator<std::pair<const Key, T>>>
bool Container::SequencialMap< Key, T, Compare, Allocator >::operator!= ( const SequencialMap< Key, T, Compare, Allocator > &  other) const
inline

Checks if the contents of two containers are equal, that is,.

Parameters
otherAnother container whose contents to compare.
Returns
true if the contents of the containers are not equal, false otherwise.

Equal means that they have the same number of elements and each element in this compares equal with the element in other at the same position.
Complexity
Constant if containers are of different size, otherwise linear in the size of the container.

◆ operator<()

template<typename Key , typename T , typename Compare = std::less<Key>, typename Allocator = std::allocator<std::pair<const Key, T>>>
bool Container::SequencialMap< Key, T, Compare, Allocator >::operator< ( const SequencialMap< Key, T, Compare, Allocator > &  other) const
inline

Compares the contents of two containers lexicographically.

Parameters
otherAnother container whose contents to compare.
Returns
true if the contents of this are lexicographically less than the contents of other, false otherwise.

The comparison is performed by a function equivalent to std::lexicographical_compare. This comparison ignores the container's ordering Compare.
Complexity
Linear in the size of the container.

◆ operator<=()

template<typename Key , typename T , typename Compare = std::less<Key>, typename Allocator = std::allocator<std::pair<const Key, T>>>
bool Container::SequencialMap< Key, T, Compare, Allocator >::operator<= ( const SequencialMap< Key, T, Compare, Allocator > &  other) const
inline

Compares the contents of two containers lexicographically.

Parameters
otherAnother container whose contents to compare.
Returns
true if the contents of this are lexicographically less than or equal the contents of other, false otherwise.

The comparison is performed by a function equivalent to std::lexicographical_compare. This comparison ignores the container's ordering Compare.
Complexity
Linear in the size of the container.

◆ operator>()

template<typename Key , typename T , typename Compare = std::less<Key>, typename Allocator = std::allocator<std::pair<const Key, T>>>
bool Container::SequencialMap< Key, T, Compare, Allocator >::operator> ( const SequencialMap< Key, T, Compare, Allocator > &  other) const
inline

Compares the contents of two containers lexicographically.

Parameters
otherAnother container whose contents to compare.
Returns
true if the contents of this are lexicographically greater than the contents of other, false otherwise.

The comparison is performed by a function equivalent to std::lexicographical_compare. This comparison ignores the container's ordering Compare.
Complexity
Linear in the size of the container.

◆ operator>=()

template<typename Key , typename T , typename Compare = std::less<Key>, typename Allocator = std::allocator<std::pair<const Key, T>>>
bool Container::SequencialMap< Key, T, Compare, Allocator >::operator>= ( const SequencialMap< Key, T, Compare, Allocator > &  other) const
inline

Compares the contents of two containers lexicographically.

Parameters
otherAnother container whose contents to compare.
Returns
true if the contents of this are lexicographically greater than or equal the contents of other, false otherwise.

The comparison is performed by a function equivalent to std::lexicographical_compare. This comparison ignores the container's ordering Compare.
Complexity
Linear in the size of the container.

◆ swap()

template<typename Key , typename T , typename Compare = std::less<Key>, typename Allocator = std::allocator<std::pair<const Key, T>>>
void Container::SequencialMap< Key, T, Compare, Allocator >::swap ( SequencialMap< Key, T, Compare, Allocator > &  other)
inline

Exchanges the contents of the container with those of other. Does not invoke any move, copy, or swap operations on individual elements.

Parameters
otherContainer to exchange the contents with.

All iterators and references remain valid. The past-the-end iterator is invalidated.
The Pred objects must be Swappable, and they are exchanged using unqualified call to non-member swap.
Complexity
Constant.

◆ key_comp()

template<typename Key , typename T , typename Compare = std::less<Key>, typename Allocator = std::allocator<std::pair<const Key, T>>>
key_compare Container::SequencialMap< Key, T, Compare, Allocator >::key_comp ( ) const
inline

Returns the function object that compares the keys, which is a copy of this container's constructor argument comp.

Returns
The key comparison function object.

Complexity
Constant.

◆ value_comp()

template<typename Key , typename T , typename Compare = std::less<Key>, typename Allocator = std::allocator<std::pair<const Key, T>>>
value_compare Container::SequencialMap< Key, T, Compare, Allocator >::value_comp ( ) const
inline

Returns a function object that compares objects of type std::map::value_type (key-value pairs) by using key_comp to compare the first components of the pairs.

Returns
The value comparison function object.

Complexity
Constant.

◆ serialize()

template<typename Key , typename T , typename Compare = std::less<Key>, typename Allocator = std::allocator<std::pair<const Key, T>>>
SerializeManipulator Container::SequencialMap< Key, T, Compare, Allocator >::serialize ( ) const
inline

Serialize the contents to output stream.

Returns
Serialization manipulator forwarding to output stream.

Sample Code

out << map.serialize();
Note
The output stream must support serialization of type Key and T.

◆ deserialize()

template<typename Key , typename T , typename Compare = std::less<Key>, typename Allocator = std::allocator<std::pair<const Key, T>>>
SerializeManipulator Container::SequencialMap< Key, T, Compare, Allocator >::deserialize ( )
inline

Deserialize the contents from input stream.

Returns
Deserialization manipulator forwarding to input stream.

Sample Code

in >> map.serialize();
Note
The input stream must support deserialization of type Key and T.

Friends And Related Function Documentation

◆ operator<<

template<typename Key , typename T , typename Compare = std::less<Key>, typename Allocator = std::allocator<std::pair<const Key, T>>>
template<typename Stream >
Stream & operator<< ( Stream &  out,
const SequencialMap< Key, T, Compare, Allocator > &  map 
)
friend

Writes the contents of list to output stream.

Template Parameters
StreamNeeds to support streaming type Key and T.
Parameters
outOutput stream.
mapMap to be written to out.
Returns
Stream& out itself.

Output format will be like:

SequencialMap(("a",0),("b",1),("c",2),("d",3),("e",4), ("f",5),("g",6),("h",7),("i",8),("k",9),...) Complexity
Linear in the size of the container, i.e., the number of elements.

◆ swap()

template<typename Key , typename T , typename Compare = std::less<Key>, typename Allocator = std::allocator<std::pair<const Key, T>>>
void swap ( Container::SequencialMap< Key, T, Compare, Allocator > &  lhs,
Container::SequencialMap< Key, T, Compare, Allocator > &  rhs 
)
related

Specializes the std::swap algorithm.

Template Parameters
KeyKey type of input maps.
TValue type of input maps.
CompareComparisonfFunction object to use for all comparisons of keys.
AllocatorAllocator to use for all memory allocations of this container.
Parameters
lhsMap whose contents to swap.
rhsMap whose contents to swap.

Specializes the std::swap algorithm for Container::SequencialMap. Swaps the maps of lhs and rhs. Calls lhs.swap(rhs).

Complexity
Constant.

◆ erase_if()

template<class Key , class T , class Compare , class Alloc , class Pred >
void erase_if ( Container::SequencialMap< Key, T, Compare, Alloc > &  c,
Pred  pred 
)
related

Erases all elements that satisfy the predicate pred from the container.

Template Parameters
KeyKey type of input maps.
TValue type of input maps.
CompareComparisonfFunction object to use for all comparisons of keys.
AllocAllocator to use for all memory allocations of this container.
PredPredicate that returns true if the element should be erased.
Parameters
cContainer from which to erase.
predPredicate that returns true if the element should be erased.

Complexity
Constant.


The documentation for this class was generated from the following file: