SeqAn3
3.4.0
The Modern C++ library for sequence analysis.
Toggle main menu visibility
Loading...
Searching...
No Matches
variant.hpp
Go to the documentation of this file.
1
// SPDX-FileCopyrightText: 2006-2025 Knut Reinert & Freie Universität Berlin
2
// SPDX-FileCopyrightText: 2016-2025 Knut Reinert & MPI für molekulare Genetik
3
// SPDX-License-Identifier: BSD-3-Clause
4
9
10
#pragma once
11
12
#include <
variant
>
13
14
#include <
seqan3/core/debug_stream/debug_stream_type.hpp
>
15
#include <
seqan3/core/detail/template_inspection.hpp
>
16
#include <
seqan3/utility/type_traits/basic.hpp
>
17
18
namespace
seqan3
19
{
20
25
template
<
typename
... variant_ts>
26
struct
std_variant_printer
<
std
::variant<variant_ts...>>
27
{
36
template
<
typename
stream_t,
typename
arg_t>
37
constexpr
void
operator()
(stream_t & stream, arg_t && arg)
const
38
{
39
if
(!arg.valueless_by_exception())
40
std::visit
(
41
[&stream](
auto
&& elem)
42
{
43
stream << elem;
44
},
45
arg);
46
else
47
stream <<
"<VALUELESS_VARIANT>"
;
48
}
49
};
50
}
// namespace seqan3
basic.hpp
Provides various type traits on generic types.
debug_stream_type.hpp
Provides seqan3::debug_stream and related types.
seqan3
The main SeqAn3 namespace.
Definition
aligned_sequence_concept.hpp:26
std
SeqAn specific customisations in the standard namespace.
seqan3::std_variant_printer< std::variant< variant_ts... > >::operator()
constexpr void operator()(stream_t &stream, arg_t &&arg) const
Prints the variant by visiting the stream operator for the corresponding type.
Definition
variant.hpp:37
seqan3::std_variant_printer
Definition
default_printer.hpp:46
template_inspection.hpp
Provides type traits for working with templates.
variant
std::visit
T visit(T... args)
Hide me
Version:
seqan3
core
debug_stream
variant.hpp
Generated on
for SeqAn3 by
1.17.0