Tuple

Specialization of Tuple for an empty parameter pack.

Defined in Rodin/Tuple.h

template <>
class Tuple<
  >;

Specialization arguments

Specialization of Tuple.

Public types

template<std::size_t Index>
using Type = void
Dummy type alias for the empty tuple.
using Parent = std::tuple<>
Parent class type.

Public static variables

static size_t Size constexpr
The number of elements in the tuple (always 0).

Constructors, destructors, conversion operators

Tuple() defaulted constexpr
Default constructor.
Tuple(const Tuple& other) defaulted constexpr
Copy constructor.
Tuple(Tuple&& other) defaulted constexpr
Move constructor.

Public functions

auto product(const Tuple<>& other) -> Tuple constexpr
Computes the Cartesian product of two empty tuples.
template<typename ... Gs>
auto concatenate(const Tuple<Gs...>& other) const -> Tuple<Gs...> constexpr
Concatenates this empty tuple with another tuple.
template<template<class> class Predicate>
auto filter() const -> Tuple constexpr
Filters the empty tuple based on a predicate.
template<typename Function>
void apply(Function&& func) constexpr
Applies a function to each element of the tuple.
auto size() const -> size_t constexpr
Returns the size of the tuple.
template<class Archive>
void serialize(Archive& archive, const unsigned int version)
Serializes the empty tuple.

Typedef documentation

template<> template<std::size_t Index>
using Type = void

Dummy type alias for the empty tuple.

Template parameters
Index Unused index parameter.

Function documentation

template<>
Tuple(const Tuple& other) defaulted constexpr

Copy constructor.

Parameters
other Source object to copy or move from.

template<>
Tuple(Tuple&& other) defaulted constexpr

Move constructor.

Parameters
other Source object to copy or move from.

template<>
Tuple product(const Tuple<>& other) constexpr

Computes the Cartesian product of two empty tuples.

Parameters
other Source object to copy or move from.
Returns An empty Tuple.

The ignored argument is the other empty tuple.

template<> template<typename ... Gs>
Tuple<Gs...> concatenate(const Tuple<Gs...>& other) const constexpr

Concatenates this empty tuple with another tuple.

Template parameters
Gs Types of elements in the other tuple.
Parameters
other The tuple to concatenate.
Returns A new tuple containing the elements of the other tuple.

template<> template<template<class> class Predicate>
Tuple filter() const constexpr

Filters the empty tuple based on a predicate.

Template parameters
Predicate A template predicate class.
Returns An empty Tuple.

template<> template<typename Function>
void apply(Function&& func) constexpr

Applies a function to each element of the tuple.

Template parameters
Function The type of the function to apply.
Parameters
func The function to apply.

template<>
size_t size() const constexpr

Returns the size of the tuple.

Returns Always returns 0.

template<> template<class Archive>
void serialize(Archive& archive, const unsigned int version)

Serializes the empty tuple.

Template parameters
Archive Serialization archive type.
Parameters
archive Serialization archive; unused because the tuple has no state.
version Serialization format version; unused by this implementation.

The archive and version arguments are ignored because an empty tuple has no state.