Class compressed_pair_imp< T1, T2, 3 >

Synopsis

#include <include/EASTL/bonus/compressed_pair.h>

template <typename T1, typename T2>
class compressed_pair_imp<T1, T2, 3> : private T1, private T2

Description

Derive from T1 and T2.

Inheritance

Ancestors: T1, T2

Methods

compressed_pair_imp overload
first overload
second overload
swapNo need to swap empty bases.

Source

Lines 247-280 in include/EASTL/bonus/compressed_pair.h.

template <typename T1, typename T2>
class compressed_pair_imp<T1, T2, 3> : private T1, private T2
{
public:
    typedef T1                                                 first_type;
    typedef T2                                                 second_type;
    typedef typename call_traits<first_type>::param_type       first_param_type;
    typedef typename call_traits<second_type>::param_type      second_param_type;
    typedef typename call_traits<first_type>::reference        first_reference;
    typedef typename call_traits<second_type>::reference       second_reference;
    typedef typename call_traits<first_type>::const_reference  first_const_reference;
    typedef typename call_traits<second_type>::const_reference second_const_reference;
    compressed_pair_imp() {}
    compressed_pair_imp(first_param_type x, second_param_type y)
        : first_type(x), second_type(y) {}
    compressed_pair_imp(first_param_type x)
        : first_type(x) {}
    compressed_pair_imp(second_param_type y)
        : second_type(y) {}
    first_reference       first()       { return *this; }
    first_const_reference first() const { return *this; }
    second_reference       second()       { return *this; }
    second_const_reference second() const { return *this; }
    // No need to swap empty bases
    void swap(compressed_pair<T1, T2>&) 
        { }
};





Add Discussion as Guest

Log in