Loading...
Searching...
No Matches
seqan3::pod_tuple< type0, types... > Struct Template Reference
Utility » Tuple

Behaves like std::tuple but is an aggregate PODType. More...

`#include <seqan3/utility/tuple/pod_tuple.hpp>`

Inheritance diagram for seqan3::pod_tuple< type0, types... >:
[legend]

## Public Member Functions

Comparison operators
constexpr bool | operator== (pod_tuple const &rhs) const noexcept
| Checks whether *this is equal to rhs.
constexpr bool | operator!= (pod_tuple const &rhs) const noexcept
| Checks whether *this is not equal to rhs.
constexpr bool | operator< (pod_tuple const &rhs) const noexcept
| Checks whether *this is less than rhs.
constexpr bool | operator> (pod_tuple const &rhs) const noexcept
| Checks whether *this is greater than rhs.
constexpr bool | operator<= (pod_tuple const &rhs) const noexcept
| Checks whether *this is less than or equal to rhs.
constexpr bool | operator>= (pod_tuple const &rhs) const noexcept
| Checks whether *this is greater than or equal to rhs.

## Related Symbols

(Note that these are not member symbols.)
| pod_tuple (types &&...) -> pod_tuple< types... >
| User defined deduction guide enables easy use.
Access an element of a pod_tuple by index
The same as std::get on a std::tuple. Note that these functions are available, both, in the seqan3 namespace and in namespace std.
constexpr auto & | get (seqan3::pod_tuple< types... > &t) noexcept
| The same as std::get on a std::tuple.
constexpr auto const & | get (seqan3::pod_tuple< types... > const &t) noexcept
| The same as std::get on a std::tuple.
constexpr auto && | get (seqan3::pod_tuple< types... > &&t) noexcept
| The same as std::get on a std::tuple.
constexpr auto const && | get (seqan3::pod_tuple< types... > const &&t) noexcept
| The same as std::get on a std::tuple.
Access an element of a pod_tuple by type
The same as std::get on a std::tuple. Note that these functions are available, both, in the seqan3 namespace and in namespace std. As is the case with std::tuple, this function is only defined if the type appears once in the tuple, i.e. std::get<int>(std::tuple<int, int>{1,2}) is not defined.
constexpr auto & | get (seqan3::pod_tuple< arg_types... > &t) noexcept
| The same as std::get on a std::tuple.
constexpr auto const & | get (seqan3::pod_tuple< arg_types... > const &t) noexcept
| The same as std::get on a std::tuple.
constexpr auto && | get (seqan3::pod_tuple< arg_types... > &&t) noexcept
| The same as std::get on a std::tuple.
constexpr auto const && | get (seqan3::pod_tuple< arg_types... > const &&t) noexcept
| The same as std::get on a std::tuple.
Related Symbols inherited from tuple_like
size_t | tuple_size_v
| A unary type trait that holds the number of elements in the tuple.
| tuple_elment_t
| A transformation trait that holds the type of elements in the tuple.
auto && | get (type &&val)
| Return the i-th element of the tuple.

## Detailed Description

template<typename type0, typename... types>
struct seqan3::pod_tuple< type0, types... >

Behaves like std::tuple but is an aggregate PODType.

Template Parameters

  type0 | The first type (the first type).
  ...types | 0-n types (the remaining types of the values to be stored).

This class behaves like std::tuple, but it is itself a POD type while std::tuple is not (even if all contained types are POD). Since the only benefit of this class is that it stays POD it actually enforces this on all types in the tuple (if you want to add non POD types, just use std::tuple instead).

You can use seqan3::get or std::get and also structured bindings to access the elements in the tuple.

// SPDX-FileCopyrightText: 2006-2025 Knut Reinert & Freie Universität Berlin
// SPDX-FileCopyrightText: 2016-2025 Knut Reinert & MPI für molekulare Genetik
// SPDX-License-Identifier: CC0-1.0
#include <seqan3/core/debug_stream.hpp>
#include <seqan3/utility/tuple/pod_tuple.hpp>
int main()
{
seqan3::pod_tuple<int, float> tuple1{3, 4.7};
static_assert(std::is_standard_layout_v<seqan3::pod_tuple<int, float>>);
static_assert(seqan3::trivial<seqan3::pod_tuple<int, float>>);
seqan3::debug_stream << std::get<int>(tuple1) << '\n'; // 3
// template parameters are automatically deduced:
seqan3::pod_tuple tuple2{17, 3.7f, 19l};
seqan3::debug_stream << std::get<0>(tuple2) << '\n'; // 17
auto [i, f, l] = tuple2; // creates an int i with value 17, float f...
seqan3::debug_stream << i << ',' << f << ',' << l << '\n'; // 17,3.7,19
}
debug_stream.hpp
Provides seqan3::debug_stream and related types.
seqan3::debug_stream
debug_stream_type debug_stream
A global instance of seqan3::debug_stream_type.
Definition debug_stream.hpp:38
std::is_standard_layout_v
T is_standard_layout_v
pod_tuple.hpp
Provides seqan3::pod_tuple.
seqan3::pod_tuple
Definition pod_tuple.hpp:27

The documentation for this struct was generated from the following file:

- pod_tuple.hpp

Hide me