Class compressed_pair

Synopsis

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

template <typename T1, typename T2>
class compressed_pair
	: private compressed_pair_imp<T1, T2,
				compressed_pair_switch<
						T1,
						T2,
						is_same<typename remove_cv<T1>::type, typename remove_cv<T2>::type>::value,
						is_empty<T1>::value,
						is_empty<T2>::value>::value>

Description

No description yet.

Methods

compressed_pair overload
first overload
second overload
swap

Source

Lines 358-398 in include/EASTL/bonus/compressed_pair.h. Line 359 in include/EASTL/bonus/compressed_pair.h.

template <typename T1, typename T2>
class compressed_pair
    : private compressed_pair_imp<T1, T2,
                compressed_pair_switch<
                        T1,
                        T2,
                        is_same<typename remove_cv<T1>::type, typename remove_cv<T2>::type>::value,
                        is_empty<T1>::value,
                        is_empty<T2>::value>::value>
{
private:
    typedef compressed_pair_imp<T1, T2,
            compressed_pair_switch<
                    T1,
                    T2,
                    is_same<typename remove_cv<T1>::type, typename remove_cv<T2>::type>::value,
                    is_empty<T1>::value,
                    is_empty<T2>::value>::value> base;
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() : base() {}
    compressed_pair(first_param_type x, second_param_type y) : base(x, y) {}
    explicit compressed_pair(first_param_type x) : base(x) {}
    explicit compressed_pair(second_param_type y) : base(y) {}
    first_reference       first()       { return base::first(); }
    first_const_reference first() const { return base::first(); }
    second_reference       second()       { return base::second(); }
    second_const_reference second() const { return base::second(); }
    void swap(compressed_pair& y) { base::swap(y); }
};





Add Discussion as Guest

Log in