Algorithms Library Toolkit
A toolkit for algorithms, especially for algorithms on formal languages
Public Member Functions
ext::tuple< Ts > Class Template Reference

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

#include <tuple.hpp>

Inheritance diagram for ext::tuple< Ts >:
[legend]
Collaboration diagram for ext::tuple< Ts >:
[legend]

Public Member Functions

 tuple ()=default
 
 tuple (const tuple &other)=default
 
 tuple (tuple &&other)=default
 
tupleoperator= (tuple &&other)=default
 
tupleoperator= (const tuple &other)=default
 
template<std::size_t I>
auto & get () &
 Inherited behavior of get for non-const instance. More...
 
template<std::size_t I>
auto && get () &&
 New behavior of get for rvalue referenced instance. More...
 
template<std::size_t I>
const auto & get () const &
 Inherited behavior of get fro const instance. More...
 
template<class T , class R >
requires ( sizeof ... ( Ts ) == 2 )
 operator ext::pair< T, R > () const
 Allow cast of tuple of two values to pair. More...
 
template<class T2 , class R2 >
constexpr auto operator<=> (const ext::pair< T2, R2 > &second) const
 

Detailed Description

template<typename ... Ts>
class ext::tuple< Ts >

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

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

Template Parameters
Types... the types inside the tuple

Constructor & Destructor Documentation

◆ tuple() [1/3]

template<typename ... Ts>
ext::tuple< Ts >::tuple ( )
default

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

◆ tuple() [2/3]

template<typename ... Ts>
ext::tuple< Ts >::tuple ( const tuple< Ts > &  other)
default

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

◆ tuple() [3/3]

template<typename ... Ts>
ext::tuple< Ts >::tuple ( tuple< Ts > &&  other)
default

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

Member Function Documentation

◆ get() [1/3]

template<typename ... Ts>
template<std::size_t I>
auto & ext::tuple< Ts >::get ( ) &
inline

Inherited behavior of get for non-const instance.

Template Parameters
Ithe index to retrieve
Returns
reference to the value at index I

◆ get() [2/3]

template<typename ... Ts>
template<std::size_t I>
auto && ext::tuple< Ts >::get ( ) &&
inline

New behavior of get for rvalue referenced instance.

Template Parameters
Ithe index to retrieve
Returns
rvalue reference to the value at index I

◆ get() [3/3]

template<typename ... Ts>
template<std::size_t I>
const auto & ext::tuple< Ts >::get ( ) const &
inline

Inherited behavior of get fro const instance.

Template Parameters
Ithe index to retrieve
Returns
const reference to the value at index I

◆ operator ext::pair< T, R >()

template<typename ... Ts>
template<class T , class R >
requires ( sizeof ... ( Ts ) == 2 )
ext::tuple< Ts >::operator ext::pair< T, R > ( ) const
inline

Allow cast of tuple of two values to pair.

Returns
casted pair

◆ operator<=>()

template<typename ... Ts>
template<class T2 , class R2 >
constexpr auto ext::tuple< Ts >::operator<=> ( const ext::pair< T2, R2 > &  second) const
constexpr
Here is the call graph for this function:

◆ operator=() [1/2]

template<typename ... Ts>
tuple & ext::tuple< Ts >::operator= ( const tuple< Ts > &  other)
default

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

◆ operator=() [2/2]

template<typename ... Ts>
tuple & ext::tuple< Ts >::operator= ( tuple< Ts > &&  other)
default

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


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