ORIGINAL
Loading...
Searching...
No Matches
tuple.h File Reference

Heterogeneous tuple container implementation. More...

#include "printable.h"
#include "comparable.h"
#include "couple.h"
#include "types.h"
Include dependency graph for tuple.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

class  original::tuple< TYPES >
 Container for multiple heterogeneous elements. More...
 
struct  std::tuple_size< original::tuple< TYPES... > >
 Specialization of tuple_size for tuple to enable structured bindings. More...
 
struct  std::tuple_element< I, original::tuple< TYPES... > >
 Specialization of tuple_element for tuple to enable structured bindings. More...
 

Namespaces

namespace  original
 Main namespace for the project Original.
 

Functions

template<typename F_TYPE, typename S_TYPE>
tuple< F_TYPE, S_TYPE > original::makeTuple (const couple< F_TYPE, S_TYPE > &cp)
 
template<typename... L_TYPES, typename... R_TYPES>
tuple< L_TYPES..., R_TYPES... > original::operator+ (const tuple< L_TYPES... > &lt, const tuple< R_TYPES... > &rt)
 
template<std::size_t I, typename... TYPES>
constexpr auto & std::get (original::tuple< TYPES... > &t) noexcept
 Structured binding support - get for non-const lvalue reference.
 
template<std::size_t I, typename... TYPES>
constexpr const auto & std::get (const original::tuple< TYPES... > &t) noexcept
 Structured binding support - get for const lvalue reference.
 
template<std::size_t I, typename... TYPES>
constexpr auto && std::get (original::tuple< TYPES... > &&t) noexcept
 Structured binding support - get for rvalue reference.
 

Detailed Description

Heterogeneous tuple container implementation.

This file implements a type-safe, compile-time fixed-size tuple container with:

  • Element access by index
  • Element modification
  • Equality comparison
  • Formatted output
  • Move semantics
  • Structured binding support
  • Tuple concatenation and slicing
Note
Structured binding is enabled via std::tuple_size and std::tuple_element specializations. Value type deduction is used to ensure compatibility with const auto& [a, b, c] = myTuple syntax.

Function Documentation

◆ get() [1/3]

template<std::size_t I, typename... TYPES>
const auto & std::get ( const original::tuple< TYPES... > & t)
constexprnoexcept

Structured binding support - get for const lvalue reference.

Template Parameters
IIndex of element
TYPESVariadic template parameter list of element types
Parameters
ttuple to get element from
Returns
Const reference to the requested element
Note
noexcept qualified

◆ get() [2/3]

template<std::size_t I, typename... TYPES>
auto && std::get ( original::tuple< TYPES... > && t)
constexprnoexcept

Structured binding support - get for rvalue reference.

Template Parameters
IIndex of element
TYPESVariadic template parameter list of element types
Parameters
ttuple to get element from
Returns
Rvalue reference to the requested element
Note
noexcept qualified

◆ get() [3/3]

template<std::size_t I, typename... TYPES>
auto & std::get ( original::tuple< TYPES... > & t)
constexprnoexcept

Structured binding support - get for non-const lvalue reference.

Template Parameters
IIndex of element
TYPESVariadic template parameter list of element types
Parameters
ttuple to get element from
Returns
Reference to the requested element
Note
noexcept qualified