iffl  1.3.4
Implements Intrusive Flat Forward List container
Public Member Functions | List of all members
iffl::compressed_pair< T1, T2, false > Class Template Referencefinal

Specialization for the case when Empty Base Class Optimization EBCO would not work. More...

#include <iffl_common.h>

Public Member Functions

template<class... P>
constexpr compressed_pair (zero_then_variadic_args_t, P &&... p)
 Constructor. More...
 
template<class P1 , class... P2>
constexpr compressed_pair (one_then_variadic_args_t, P1 &&p1, P2 &&... p2)
 Constructor. More...
 
constexpr T1 & get_first () noexcept
 
constexpr T1 const & get_first () const noexcept
 
constexpr T2 & get_second () noexcept
 
constexpr T2 const & get_second () const noexcept
 

Detailed Description

template<class T1, class T2>
class iffl::compressed_pair< T1, T2, false >

Specialization for the case when Empty Base Class Optimization EBCO would not work.

Template Parameters
T1- First type. In this partial specialization it is a member.
T2- Second type is always a member

Store a pair of values, deriving from empty first. This is a template specialization for the case when inheriting from T1 would not help or work.

Constructor & Destructor Documentation

◆ compressed_pair() [1/2]

template<class T1 , class T2 >
template<class... P>
constexpr iffl::compressed_pair< T1, T2, false >::compressed_pair ( zero_then_variadic_args_t  ,
P &&...  p 
)
inlineexplicit

Constructor.

Template Parameters
P- variadic parameter pack forwarded to the constructor of T2
Parameters
p- parameters for the T2 constructor

Value initialize first parameter, and passes all other parameters to the constructor of second

◆ compressed_pair() [2/2]

template<class T1 , class T2 >
template<class P1 , class... P2>
constexpr iffl::compressed_pair< T1, T2, false >::compressed_pair ( one_then_variadic_args_t  ,
P1 &&  p1,
P2 &&...  p2 
)
inline

Constructor.

Template Parameters
P1- parameter used to initialize T1
P2- variadic parameter pack forwarded to the constructor of T2
Parameters
p1- parameter for the T1 constructor
p2- parameters for the T2 constructor

Constructs first parameter from p1, and passes all other parameters to the constructor of second.

Member Function Documentation

◆ get_first() [1/2]

template<class T1 , class T2 >
constexpr T1& iffl::compressed_pair< T1, T2, false >::get_first ( )
inlinenoexcept
Returns
Returns a reference to the first element of compressed pair

◆ get_first() [2/2]

template<class T1 , class T2 >
constexpr T1 const& iffl::compressed_pair< T1, T2, false >::get_first ( ) const
inlinenoexcept
Returns
Returns a const reference to the first element of compressed pair

◆ get_second() [1/2]

template<class T1 , class T2 >
constexpr T2& iffl::compressed_pair< T1, T2, false >::get_second ( )
inlinenoexcept
Returns
Returns a reference to the second element of compressed pair

◆ get_second() [2/2]

template<class T1 , class T2 >
constexpr T2 const& iffl::compressed_pair< T1, T2, false >::get_second ( ) const
inlinenoexcept
Returns
Returns a const reference to the second element of compressed pair

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