Class compressed_pair_imp< T1, T2, 5 >

Synopsis

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

template <typename T1, typename T2>
class compressed_pair_imp<T1, T2, 5>

Description

T1 == T2 and are not empty.

Methods

compressed_pair_imp overload
first overload
second overload
swap

Source

Lines 318-354 in include/EASTL/bonus/compressed_pair.h.

template <typename T1, typename T2>
class compressed_pair_imp<T1, T2, 5>
{
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)
        : mFirst(x), mSecond(y) {}
    compressed_pair_imp(first_param_type x)
        : mFirst(x), mSecond(x) {}
    first_reference       first()       { return mFirst; }
    first_const_reference first() const { return mFirst; }
    second_reference       second()       { return mSecond; }
    second_const_reference second() const { return mSecond; }
    void swap(compressed_pair<T1, T2>& y)
    {
        cp_swap(mFirst, y.first());
        cp_swap(mSecond, y.second());
    }
private:
    first_type  mFirst;
    second_type mSecond;
};





Add Discussion as Guest

Log in