Loading...
Searching...
No Matches
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...

#include <Tuple2.H>

Inheritance diagram for Tuple2< T1, T2 >:

Public Types

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

Public Member Functions

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

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 50 of file Tuple2.H.

Member Typedef Documentation

◆ first_type

template<class T1, class T2 = T1>
typedef T1 first_type

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

Definition at line 64 of file Tuple2.H.

◆ second_type

template<class T1, class T2 = T1>
typedef T2 second_type

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

Definition at line 69 of file Tuple2.H.

Constructor & Destructor Documentation

◆ Tuple2() [1/6]

template<class T1, class T2 = T1>
Tuple2 ( )
default

Default construct.

◆ Tuple2() [2/6]

template<class T1, class T2 = T1>
Tuple2 ( const T1 & f,
const T2 & s )
inline

Copy construct from components.

Definition at line 82 of file Tuple2.H.

◆ Tuple2() [3/6]

template<class T1, class T2 = T1>
Tuple2 ( T1 && f,
T2 && s )
inline

Move construct from components.

Definition at line 91 of file Tuple2.H.

◆ Tuple2() [4/6]

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

Copy construct from std::pair.

Definition at line 100 of file Tuple2.H.

◆ Tuple2() [5/6]

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

Move construct from std::pair.

Definition at line 109 of file Tuple2.H.

◆ Tuple2() [6/6]

template<class T1, class T2 = T1>
Tuple2 ( Istream & is)
inlineexplicit

Construct from Istream.

Definition at line 118 of file Tuple2.H.

Member Function Documentation

◆ first() [1/2]

◆ first() [2/2]

template<class T1, class T2 = T1>
T1 & first ( )
inlinenoexcept

Access the first element.

Definition at line 137 of file Tuple2.H.

◆ second() [1/2]

◆ second() [2/2]

template<class T1, class T2 = T1>
T2 & second ( )
inlinenoexcept

Access the second element.

Definition at line 147 of file Tuple2.H.


The documentation for this class was generated from the following files:
  • src/OpenFOAM/primitives/strings/stringOps/stringOps.H
  • src/OpenFOAM/primitives/tuples/Tuple2.H