Algorithms Library Toolkit
A toolkit for algorithms, especially for algorithms on formal languages
Public Types | Public Member Functions
ext::multimap< T, R, Cmp, Alloc > Class Template Reference

Class extending the multimap class from the standard library. Original reason is to allow printing of the container with overloaded operator <<. More...

#include <multimap.hpp>

Inheritance diagram for ext::multimap< T, R, Cmp, Alloc >:
[legend]
Collaboration diagram for ext::multimap< T, R, Cmp, Alloc >:
[legend]

Public Types

using iterator = typename std::multimap< T, R, Cmp, Alloc >::iterator
 The iterator type is inheried. More...
 

Public Member Functions

 multimap ()=default
 
 multimap (const multimap &other)=default
 
 multimap (multimap &&other)=default
 
multimapoperator= (multimap &&other)=default
 
multimapoperator= (const multimap &other)=default
 
template<class Iterator >
 multimap (const ext::iterator_range< Iterator > &range)
 
iterator insert (const T &key, const R &value)
 Insert variant with explicit key and value parameters. More...
 
iterator insert (const T &key, R &&value)
 Insert variant with explicit key and value parameters. More...
 
iterator insert (T &&key, const R &value)
 Insert variant with explicit key and value parameters. More...
 
iterator insert (T &&key, R &&value)
 Insert variant with explicit key and value parameters. More...
 
auto begin () &
 Inherited behavior of begin for non-const instance. More...
 
auto begin () const &
 Inherited behavior of begin for const instance. More...
 
auto begin () &&
 New variant of begin for rvalues. More...
 
auto end () &
 Inherited behavior of end for non-const instance. More...
 
auto end () const &
 Inherited behavior of end for const instance. More...
 
auto end () &&
 New variant of end for rvalues. More...
 
auto range () &
 Make range of non-const begin to end iterators. More...
 
auto range () const &
 Make range of non-const begin to end iterators. More...
 
auto range () &&
 Make range of move begin to end iterators. More...
 
template<class K >
auto equal_range (K &&key) const &
 Make range of elements with key equal to the key. More...
 
template<class K >
auto equal_range (K &&key) &
 Make range of elements with key equal to the key. More...
 
template<class K >
auto equal_range (K &&key) &&
 Make range of elements with key equal to the key. More...
 

Detailed Description

template<typename T, typename R, typename Cmp = std::less < >, typename Alloc = std::allocator < std::pair < const T, R > >>
class ext::multimap< T, R, Cmp, Alloc >

Class extending the multimap class from the standard library. Original reason is to allow printing of the container with overloaded operator <<.

The class mimics the behavior of the multimap from the standatd library.

Template Parameters
Tthe type of keys inside the multimap
Rthe type of values inside the multimap
Cmpthe comparator type used to order keys
Allocthe allocator of values of type T

Member Typedef Documentation

◆ iterator

template<typename T , typename R , typename Cmp = std::less < >, typename Alloc = std::allocator < std::pair < const T, R > >>
using ext::multimap< T, R, Cmp, Alloc >::iterator = typename std::multimap<T, R, Cmp, Alloc>::iterator

The iterator type is inheried.

Constructor & Destructor Documentation

◆ multimap() [1/4]

template<typename T , typename R , typename Cmp = std::less < >, typename Alloc = std::allocator < std::pair < const T, R > >>
ext::multimap< T, R, Cmp, Alloc >::multimap ( )
default

Default constructor needed by g++ since it is not inherited

◆ multimap() [2/4]

template<typename T , typename R , typename Cmp = std::less < >, typename Alloc = std::allocator < std::pair < const T, R > >>
ext::multimap< T, R, Cmp, Alloc >::multimap ( const multimap< T, R, Cmp, Alloc > &  other)
default

Copy constructor needed by g++ since it is not inherited

◆ multimap() [3/4]

template<typename T , typename R , typename Cmp = std::less < >, typename Alloc = std::allocator < std::pair < const T, R > >>
ext::multimap< T, R, Cmp, Alloc >::multimap ( multimap< T, R, Cmp, Alloc > &&  other)
default

Move constructor needed by g++ since it is not inherited

◆ multimap() [4/4]

template<typename T , typename R , typename Cmp = std::less < >, typename Alloc = std::allocator < std::pair < const T, R > >>
template<class Iterator >
ext::multimap< T, R, Cmp, Alloc >::multimap ( const ext::iterator_range< Iterator > &  range)
inline

Constructor from range of values.

Template Parameters
Iteratorthe type of range iterator
Parameters
rangethe source range

Member Function Documentation

◆ begin() [1/3]

template<typename T , typename R , typename Cmp = std::less < >, typename Alloc = std::allocator < std::pair < const T, R > >>
auto ext::multimap< T, R, Cmp, Alloc >::begin ( ) &
inline

Inherited behavior of begin for non-const instance.

Returns
iterator the first element of multimap
Here is the call graph for this function:
Here is the caller graph for this function:

◆ begin() [2/3]

template<typename T , typename R , typename Cmp = std::less < >, typename Alloc = std::allocator < std::pair < const T, R > >>
auto ext::multimap< T, R, Cmp, Alloc >::begin ( ) &&
inline

New variant of begin for rvalues.

Returns
move_iterator the first element of multimap
Here is the call graph for this function:

◆ begin() [3/3]

template<typename T , typename R , typename Cmp = std::less < >, typename Alloc = std::allocator < std::pair < const T, R > >>
auto ext::multimap< T, R, Cmp, Alloc >::begin ( ) const &
inline

Inherited behavior of begin for const instance.

Returns
const_iterator the first element of multimap
Here is the call graph for this function:

◆ end() [1/3]

template<typename T , typename R , typename Cmp = std::less < >, typename Alloc = std::allocator < std::pair < const T, R > >>
auto ext::multimap< T, R, Cmp, Alloc >::end ( ) &
inline

Inherited behavior of end for non-const instance.

Returns
iterator to one after the last element of multimap
Here is the call graph for this function:
Here is the caller graph for this function:

◆ end() [2/3]

template<typename T , typename R , typename Cmp = std::less < >, typename Alloc = std::allocator < std::pair < const T, R > >>
auto ext::multimap< T, R, Cmp, Alloc >::end ( ) &&
inline

New variant of end for rvalues.

Returns
move_iterator to one after the last element of multimap
Here is the call graph for this function:

◆ end() [3/3]

template<typename T , typename R , typename Cmp = std::less < >, typename Alloc = std::allocator < std::pair < const T, R > >>
auto ext::multimap< T, R, Cmp, Alloc >::end ( ) const &
inline

Inherited behavior of end for const instance.

Returns
const_iterator to one after the last element of multimap
Here is the call graph for this function:

◆ equal_range() [1/3]

template<typename T , typename R , typename Cmp = std::less < >, typename Alloc = std::allocator < std::pair < const T, R > >>
template<class K >
auto ext::multimap< T, R, Cmp, Alloc >::equal_range ( K &&  key) &
inline

Make range of elements with key equal to the key.

Template Parameters
Kthe key used in the query
Parameters
keythe value used in the query
Returns
selected range of elements
Here is the call graph for this function:

◆ equal_range() [2/3]

template<typename T , typename R , typename Cmp = std::less < >, typename Alloc = std::allocator < std::pair < const T, R > >>
template<class K >
auto ext::multimap< T, R, Cmp, Alloc >::equal_range ( K &&  key) &&
inline

Make range of elements with key equal to the key.

Template Parameters
Kthe key used in the query
Parameters
keythe value used in the query
Returns
selected range of elements
Here is the call graph for this function:

◆ equal_range() [3/3]

template<typename T , typename R , typename Cmp = std::less < >, typename Alloc = std::allocator < std::pair < const T, R > >>
template<class K >
auto ext::multimap< T, R, Cmp, Alloc >::equal_range ( K &&  key) const &
inline

Make range of elements with key equal to the key.

Template Parameters
Kthe key used in the query
Parameters
keythe value used in the query
Returns
selected range of elements
Here is the call graph for this function:
Here is the caller graph for this function:

◆ insert() [1/4]

template<typename T , typename R , typename Cmp = std::less < >, typename Alloc = std::allocator < std::pair < const T, R > >>
iterator ext::multimap< T, R, Cmp, Alloc >::insert ( const T &  key,
const R &  value 
)
inline

Insert variant with explicit key and value parameters.

Parameters
keythe key
valuethe value
Returns
pair of iterator to inserted key-value pair and true if the value was inserted or false if the key already exited
Here is the call graph for this function:
Here is the caller graph for this function:

◆ insert() [2/4]

template<typename T , typename R , typename Cmp = std::less < >, typename Alloc = std::allocator < std::pair < const T, R > >>
iterator ext::multimap< T, R, Cmp, Alloc >::insert ( const T &  key,
R &&  value 
)
inline

Insert variant with explicit key and value parameters.

Parameters
keythe key
valuethe value
Returns
pair of iterator to inserted key-value pair and true if the value was inserted or false if the key already exited
Here is the call graph for this function:

◆ insert() [3/4]

template<typename T , typename R , typename Cmp = std::less < >, typename Alloc = std::allocator < std::pair < const T, R > >>
iterator ext::multimap< T, R, Cmp, Alloc >::insert ( T &&  key,
const R &  value 
)
inline

Insert variant with explicit key and value parameters.

Parameters
keythe key
valuethe value
Returns
pair of iterator to inserted key-value pair and true if the value was inserted or false if the key already exited
Here is the call graph for this function:

◆ insert() [4/4]

template<typename T , typename R , typename Cmp = std::less < >, typename Alloc = std::allocator < std::pair < const T, R > >>
iterator ext::multimap< T, R, Cmp, Alloc >::insert ( T &&  key,
R &&  value 
)
inline

Insert variant with explicit key and value parameters.

Parameters
keythe key
valuethe value
Returns
pair of iterator to inserted key-value pair and true if the value was inserted or false if the key already exited
Here is the call graph for this function:

◆ operator=() [1/2]

template<typename T , typename R , typename Cmp = std::less < >, typename Alloc = std::allocator < std::pair < const T, R > >>
multimap & ext::multimap< T, R, Cmp, Alloc >::operator= ( const multimap< T, R, Cmp, Alloc > &  other)
default

Move operator = needed by g++ since it is not inherited

◆ operator=() [2/2]

template<typename T , typename R , typename Cmp = std::less < >, typename Alloc = std::allocator < std::pair < const T, R > >>
multimap & ext::multimap< T, R, Cmp, Alloc >::operator= ( multimap< T, R, Cmp, Alloc > &&  other)
default

Copy operator = needed by g++ since it is not inherited

◆ range() [1/3]

template<typename T , typename R , typename Cmp = std::less < >, typename Alloc = std::allocator < std::pair < const T, R > >>
auto ext::multimap< T, R, Cmp, Alloc >::range ( ) &
inline

Make range of non-const begin to end iterators.

Returns
full range over container values
Here is the call graph for this function:
Here is the caller graph for this function:

◆ range() [2/3]

template<typename T , typename R , typename Cmp = std::less < >, typename Alloc = std::allocator < std::pair < const T, R > >>
auto ext::multimap< T, R, Cmp, Alloc >::range ( ) &&
inline

Make range of move begin to end iterators.

Returns
full range over container values

◆ range() [3/3]

template<typename T , typename R , typename Cmp = std::less < >, typename Alloc = std::allocator < std::pair < const T, R > >>
auto ext::multimap< T, R, Cmp, Alloc >::range ( ) const &
inline

Make range of non-const begin to end iterators.

Returns
full range over container values
Here is the call graph for this function:

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