Tuple2< T1, T2 > Class Template Reference

A 2-tuple for storing two objects of dissimilar types. The container is similar in purpose to std::pair, but does not expose its members directly. More...

Inheritance diagram for Tuple2< T1, T2 >:
[legend]

Public Types

typedef T1 first_type
 Type of member first, the first template parameter (T1) More...
 
typedef T2 second_type
 Type of member second, the second template parameter (T2) More...
 

Public Member Functions

 Tuple2 ()=default
 Default construct. More...
 
 Tuple2 (const T1 &f, const T2 &s)
 Copy construct from components. More...
 
 Tuple2 (T1 &&f, T2 &&s)
 Move construct from components. More...
 
 Tuple2 (const std::pair< T1, T2 > &vals)
 Copy construct from std::pair. More...
 
 Tuple2 (std::pair< T1, T2 > &&vals)
 Move construct from std::pair. More...
 
 Tuple2 (Istream &is)
 Construct from Istream. More...
 
const T1 & first () const noexcept
 Return first. More...
 
T1 & first () noexcept
 Return first. More...
 
const T2 & second () const noexcept
 Return second. More...
 
T2 & second () noexcept
 Return second. More...
 

Detailed Description

template<class T1, class T2 = T1>
class Foam::Tuple2< T1, T2 >

A 2-tuple for storing two objects of dissimilar types. The container is similar in purpose to std::pair, but does not expose its members directly.

See also
Foam::Pair for storing two objects of identical types.

Definition at line 57 of file Tuple2.H.

Member Typedef Documentation

◆ first_type

typedef T1 first_type

Type of member first, the first template parameter (T1)

Definition at line 69 of file Tuple2.H.

◆ second_type

typedef T2 second_type

Type of member second, the second template parameter (T2)

Definition at line 72 of file Tuple2.H.

Constructor & Destructor Documentation

◆ Tuple2() [1/6]

Tuple2 ( )
default

Default construct.

◆ Tuple2() [2/6]

Tuple2 ( const T1 &  f,
const T2 &  s 
)
inline

Copy construct from components.

Definition at line 81 of file Tuple2.H.

◆ Tuple2() [3/6]

Tuple2 ( T1 &&  f,
T2 &&  s 
)
inline

Move construct from components.

Definition at line 88 of file Tuple2.H.

◆ Tuple2() [4/6]

Tuple2 ( const std::pair< T1, T2 > &  vals)
inline

Copy construct from std::pair.

Definition at line 95 of file Tuple2.H.

◆ Tuple2() [5/6]

Tuple2 ( std::pair< T1, T2 > &&  vals)
inline

Move construct from std::pair.

Definition at line 102 of file Tuple2.H.

◆ Tuple2() [6/6]

Tuple2 ( Istream is)
inlineexplicit

Construct from Istream.

Definition at line 109 of file Tuple2.H.

Member Function Documentation

◆ first() [1/2]

◆ first() [2/2]

T1 & first ( )
inlinenoexcept

Return first.

Definition at line 124 of file Tuple2.H.

◆ second() [1/2]

◆ second() [2/2]

T2 & second ( )
inlinenoexcept

Return second.

Definition at line 136 of file Tuple2.H.


The documentation for this class was generated from the following files: