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

#include <set.hpp>

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

Public Member Functions

 set ()=default
 
 set (const set &other)=default
 
 set (set &&other)=default
 
setoperator= (set &&other)=default
 
setoperator= (const set &other)=default
 
template<class Iterator >
 set (const ext::iterator_range< Iterator > &range)
 
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 Cmp = std::less < >, typename Alloc = std::allocator < T >>
class ext::set< T, Cmp, Alloc >

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

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

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

Constructor & Destructor Documentation

◆ set() [1/4]

template<typename T , typename Cmp = std::less < >, typename Alloc = std::allocator < T >>
ext::set< T, Cmp, Alloc >::set ( )
default

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

◆ set() [2/4]

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

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

◆ set() [3/4]

template<typename T , typename Cmp = std::less < >, typename Alloc = std::allocator < T >>
ext::set< T, Cmp, Alloc >::set ( set< T, Cmp, Alloc > &&  other)
default

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

◆ set() [4/4]

template<typename T , typename Cmp = std::less < >, typename Alloc = std::allocator < T >>
template<class Iterator >
ext::set< T, Cmp, Alloc >::set ( const ext::iterator_range< Iterator > &  range)
inlineexplicit

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 Cmp = std::less < >, typename Alloc = std::allocator < T >>
auto ext::set< T, Cmp, Alloc >::begin ( ) &
inline

Inherited behavior of begin for non-const instance.

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

◆ begin() [2/3]

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

New variant of begin for rvalues.

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

◆ begin() [3/3]

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

Inherited behavior of begin for const instance.

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

◆ end() [1/3]

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

Inherited behavior of end for non-const instance.

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

◆ end() [2/3]

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

New variant of end for rvalues.

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

◆ end() [3/3]

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

Inherited behavior of end for const instance.

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

◆ equal_range() [1/3]

template<typename T , typename Cmp = std::less < >, typename Alloc = std::allocator < T >>
template<class K >
auto ext::set< T, 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

◆ equal_range() [2/3]

template<typename T , typename Cmp = std::less < >, typename Alloc = std::allocator < T >>
template<class K >
auto ext::set< T, 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 Cmp = std::less < >, typename Alloc = std::allocator < T >>
template<class K >
auto ext::set< T, 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 caller graph for this function:

◆ operator=() [1/2]

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

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

◆ operator=() [2/2]

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

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

◆ range() [1/3]

template<typename T , typename Cmp = std::less < >, typename Alloc = std::allocator < T >>
auto ext::set< T, 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:

◆ range() [2/3]

template<typename T , typename Cmp = std::less < >, typename Alloc = std::allocator < T >>
auto ext::set< T, 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 Cmp = std::less < >, typename Alloc = std::allocator < T >>
auto ext::set< T, 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: