SeqAn3 3.4.0-rc.1
The Modern C++ library for sequence analysis.
Loading...
Searching...
No Matches
tuple.hpp
Go to the documentation of this file.
1// SPDX-FileCopyrightText: 2006-2024 Knut Reinert & Freie Universität Berlin
2// SPDX-FileCopyrightText: 2016-2024 Knut Reinert & MPI für molekulare Genetik
3// SPDX-License-Identifier: BSD-3-Clause
4
10#pragma once
11
12#include <concepts>
13#include <ranges>
14
18
19namespace seqan3
20{
24} // namespace seqan3
25
26namespace seqan3::detail
27{
28
30template <typename char_t, typename tuple_t, std::size_t... I>
32{
33 using std::get;
34 s << '(';
35 ((s << (I == 0 ? "" : ",") << get<I>(t)), ...);
36 s << ')';
37}
38
50template <typename tuple_t>
51concept debug_streamable_tuple = !
52std::ranges::input_range<tuple_t> && !alphabet<tuple_t> && // exclude alphabet_tuple_base
55} // namespace seqan3::detail
56
57namespace seqan3
58{
59
66template <typename char_t, typename tuple_t>
67 requires (detail::debug_streamable_tuple<tuple_t>)
68inline debug_stream_type<char_t> & operator<<(debug_stream_type<char_t> & s, tuple_t && t)
69{
71 std::forward<tuple_t>(t),
73 return s;
74}
75
77
78} // namespace seqan3
Core alphabet concept and free function/type trait wrappers.
A "pretty printer" for most SeqAn data structures and related types.
Definition debug_stream_type.hpp:75
Provides seqan3::debug_stream and related types.
The generic alphabet concept that covers most data types used in ranges.
A helper concept to avoid ambiguous overloads with the debug stream operator for alignments.
Whether a type behaves like a tuple.
The internal SeqAn3 namespace.
Definition aligned_sequence_concept.hpp:26
void print_tuple(debug_stream_type< char_t > &s, tuple_t &&t, std::index_sequence< I... > const &)
Helper function to print elements of a tuple separately.
Definition tuple.hpp:31
The main SeqAn3 namespace.
Definition aligned_sequence_concept.hpp:26
T tuple_size_v
Provides seqan3::tuple_like.
Hide me