|
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 |
| Returns a reference to the first element of compressed pair.
|
|
constexpr T1 const & | get_first () const noexcept |
| Returns a const reference to the first element of compressed pair.
|
|
constexpr T2 & | get_second () noexcept |
| Returns a reference to the second element of compressed pair.
|
|
constexpr T2 const & | get_second () const noexcept |
| Returns a const reference to the second element of compressed pair.
|
|
template<class T1, class T2, bool = std::is_empty_v<T1> && !std::is_final_v<T1>>
class iffl::compressed_pair< T1, T2, bool >
Empty Base Class Optimization EBCO helper.
- Template Parameters
-
T1 | - First type is inherited from if it is possible, and if it safes space |
T2 | - Second type is always a member |
Store a pair of values, deriving from empty first. This is a general template for the case when inheriting from T1 would help. We use SFINAE on the 3rd parameter to fail this instantiation when EBCO would not help or would not work. Other specialization should be used in that case. This is a naive implementation borrowed from the MSVC CRT. More complete implementation can be found in boost