DASH  0.3.0
dash::Pair< T1, T2 > Struct Template Reference

A trivially-copyable implementation of std::pair to be used as element type of DASH containers. More...

#include <Pair.h>

Public Types

typedef T1 first_type
 
typedef T2 second_type
 first_type is the first bound type More...
 

Public Member Functions

constexpr Pair ()
 second is a copy of the second object More...
 
constexpr Pair (const T1 &__a, const T2 &__b)
 Two objects may be passed to a Pair constructor to be copied. More...
 
template<class U1 , class U2 , class = typename std::enable_if< std::is_convertible<const U1&, T1>::value && std::is_convertible<const U2&, T2>::value>::value>
constexpr Pair (const Pair< U1, U2 > &p)
 A Pair might be constructed from another pair iff first and second are convertible. More...
 
constexpr Pair (const Pair &)=default
 
constexpr Pair (Pair &&)=default
 
template<class U1 , class = typename std::enable_if<std::is_convertible<U1, T1>::value>::type>
constexpr Pair (U1 &&x, const T2 &y)
 
template<class U2 , class = typename std::enable_if<std::is_convertible<U2, T2>::value>::type>
constexpr Pair (const T1 &x, U2 &&y)
 
template<class U1 , class U2 , class = typename std::enable_if<std::is_convertible<U1, T1>::value && std::is_convertible<U2, T2>::value>::type>
constexpr Pair (U1 &&x, U2 &&y)
 
template<class U1 , class U2 , class = typename std::enable_if<std::is_convertible<U1, T1>::value && std::is_convertible<U2, T2>::value>::type>
constexpr Pair (Pair< U1, U2 > &&p)
 
Pairoperator= (const Pair &p)=default
 
Pairoperator= (Pair &&p) noexcept(std::is_nothrow_move_assignable< T1 >::value &&std::is_nothrow_move_assignable< T2 >::value)=default
 
template<class U1 , class U2 >
Pairoperator= (const Pair< U1, U2 > &p)
 
template<class U1 , class U2 >
Pairoperator= (Pair< U1, U2 > &&p)
 
void swap (Pair &p) noexcept(noexcept(swap(first, p.first)) &&noexcept(swap(second, p.second)))
 

Public Attributes

T1 first
 second_type is the second bound type More...
 
T2 second
 first is a copy of the first object More...
 

Detailed Description

template<class T1, class T2>
struct dash::Pair< T1, T2 >

A trivially-copyable implementation of std::pair to be used as element type of DASH containers.

The implementation was mainly taken and adapted from std_pair.h.

Todo:
Implementation of tuples are missing at the moment.

Definition at line 22 of file Pair.h.

Member Typedef Documentation

◆ second_type

template<class T1, class T2>
typedef T2 dash::Pair< T1, T2 >::second_type

first_type is the first bound type

Definition at line 25 of file Pair.h.

Constructor & Destructor Documentation

◆ Pair() [1/3]

template<class T1, class T2>
constexpr dash::Pair< T1, T2 >::Pair ( )
inline

second is a copy of the second object

The default constructor.

Definition at line 33 of file Pair.h.

Referenced by dash::Pair< T1, T2 >::Pair().

34  : first(), second()
35  { }
T1 first
second_type is the second bound type
Definition: Pair.h:27
T2 second
first is a copy of the first object
Definition: Pair.h:28

◆ Pair() [2/3]

template<class T1, class T2>
constexpr dash::Pair< T1, T2 >::Pair ( const T1 &  __a,
const T2 &  __b 
)
inline

Two objects may be passed to a Pair constructor to be copied.

Definition at line 40 of file Pair.h.

41  : first(__a), second(__b)
42  { }
T1 first
second_type is the second bound type
Definition: Pair.h:27
T2 second
first is a copy of the first object
Definition: Pair.h:28

◆ Pair() [3/3]

template<class T1, class T2>
template<class U1 , class U2 , class = typename std::enable_if< std::is_convertible<const U1&, T1>::value && std::is_convertible<const U2&, T2>::value>::value>
constexpr dash::Pair< T1, T2 >::Pair ( const Pair< U1, U2 > &  p)
inline

A Pair might be constructed from another pair iff first and second are convertible.

Definition at line 52 of file Pair.h.

References dash::Pair< T1, T2 >::first, dash::Pair< T1, T2 >::Pair(), and dash::Pair< T1, T2 >::second.

53  : first(p.first), second(p.second)
54  { }
T1 first
second_type is the second bound type
Definition: Pair.h:27
T2 second
first is a copy of the first object
Definition: Pair.h:28

Member Data Documentation

◆ first

template<class T1, class T2>
T1 dash::Pair< T1, T2 >::first

second_type is the second bound type

Definition at line 27 of file Pair.h.

Referenced by dash::make_pair(), dash::operator<(), dash::operator==(), and dash::Pair< T1, T2 >::Pair().

◆ second

template<class T1, class T2>
T2 dash::Pair< T1, T2 >::second

first is a copy of the first object

Definition at line 28 of file Pair.h.

Referenced by dash::make_pair(), dash::operator==(), and dash::Pair< T1, T2 >::Pair().


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