Dune Core Modules (2.3.1)

tuples.hh File Reference

Fallback implementation of the std::tuple class. More...

#include <iostream>
#include "typetraits.hh"
#include "static_assert.hh"
#include "unused.hh"

Go to the source code of this file.

Classes

struct  Dune::Nil
 An empty class. More...
 
struct  Dune::Pair< T1, TT >
 A tuple consisting of two objects. More...
 
struct  Dune::Pair< T1, Nil >
 A tuple consisting of one object. Specialization of Pair that really is a single value. More...
 
struct  Dune::TupleToPairs< T1, T2, T3, T4, T5, T6, T7, T8, T9 >
 Converts the Tuple to a list of pairs. More...
 
struct  Dune::TupleToPairs< T1, Nil, Nil, Nil, Nil, Nil, Nil, Nil, Nil >
 Specialization for a tuple consisting only of one type. More...
 
class  Dune::tuple< T1, T2, T3, T4, T5, T6, T7, T8, T9 >
 A Tuple of objects. More...
 
struct  Dune::tuple_element< N, Tuple >
 Get the type of the N-th element of the tuple. More...
 
struct  Dune::tuple_element< 0, Pair< T1, T2 > >
 Get the type of the first element of the tuple. More...
 
struct  Dune::Element< N >
 Get the N-th element of a tuple. More...
 
struct  Dune::Element< 0 >
 Get the first element of a tuple. More...
 
struct  Dune::tuple_size< T >
 Template meta_programm to query the size of a tuple. More...
 

Namespaces

 Dune
 Dune namespace.
 

Functions

template<typename T1 , typename T2 , typename U1 , typename U2 >
bool Dune::operator== (const Pair< T1, T2 > &tuple1, const Pair< U1, U2 > &tuple2)
 Equality comparison operator for tuples. More...
 
template<typename T1 , typename T2 , typename U1 , typename U2 >
bool Dune::operator!= (const Pair< T1, T2 > &tuple1, const Pair< U1, U2 > &tuple2)
 Inequality comparison operator for tuples. More...
 
template<typename T1 , typename T2 , typename U1 , typename U2 >
bool Dune::operator< (const Pair< T1, T2 > &tuple1, const Pair< U1, U2 > &tuple2)
 Less operator for tuples. More...
 
template<typename T1 , typename U1 >
bool Dune::operator== (const Pair< T1, Nil > &tuple1, const Pair< U1, Nil > &tuple2)
 Equality comparison operator for tuples. More...
 
template<typename T1 , typename U1 >
bool Dune::operator!= (const Pair< T1, Nil > &tuple1, const Pair< U1, Nil > &tuple2)
 Inequality comparison operator for tuples. More...
 
template<typename T1 , typename U1 >
bool Dune::operator< (const Pair< T1, Nil > &tuple1, const Pair< U1, Nil > &tuple2)
 Less operator for tuples. More...
 
template<typename T1 , typename U1 , typename U2 >
bool Dune::operator== (const Pair< T1, Nil > &tuple1, const Pair< U1, U2 > &tuple2)
 Equality comparison operator for tuples. More...
 
template<typename T1 , typename U1 , typename U2 >
bool Dune::operator!= (const Pair< T1, Nil > &tuple1, const Pair< U1, U2 > &tuple2)
 Inequality comparison operator for tuples. More...
 
template<typename T1 , typename T2 , typename U1 >
bool Dune::operator== (const Pair< T1, T2 > &tuple1, const Pair< U1, Nil > &tuple2)
 Equality comparison operator for tuples. More...
 
template<typename T1 , typename T2 , typename U1 >
bool Dune::operator!= (const Pair< T1, T2 > &tuple1, const Pair< U1, Nil > &tuple2)
 Inequality comparison operator for tuples. More...
 
template<typename T1 , typename T2 >
Pair< T1, T2 > Dune::makePair (const T1 &first, const T2 &second)
 Create a tuple and initialize it. More...
 
template<typename T1 , typename T2 >
std::ostream & Dune::operator<< (std::ostream &os, const Pair< T1, T2 > &pair)
 Print a pair or tuple.
 
template<typename T1 , typename T2 >
std::istream & Dune::operator>> (std::istream &is, Pair< T1, T2 > &pair)
 Read a pair or tuple.
 

Detailed Description

Fallback implementation of the std::tuple class.

This a refined implementation of the approach defined in in the article "Tuples and multiple return values in C++" of Jaakko Järvi (Turku Centre of Computer Science, TUCS Technical Report No 249, March 1999, ISBN 952-12-0401-X, ISSN 1239-1891) available from the TUCS publications archive

Author
Markus Blatt
Creative Commons License   |  Legal Statements / Impressum  |  Hosted by TU Dresden  |  generated with Hugo v0.80.0 (May 3, 22:32, 2024)