SeqAn3 3.4.0-rc.4
The Modern C++ library for sequence analysis.
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
10#pragma once
11
12#include <variant>
13
17
18namespace seqan3
19{
20
25template <typename... variant_ts>
26struct 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())
41 [&stream](auto && elem)
42 {
43 stream << elem;
44 },
45 arg);
46 else
47 stream << "<VALUELESS_VARIANT>";
48 }
49};
50} // namespace seqan3
Provides various type traits on generic types.
Provides seqan3::debug_stream and related types.
The main SeqAn3 namespace.
Definition aligned_sequence_concept.hpp:26
SeqAn specific customisations in the standard namespace.
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
Definition default_printer.hpp:46
Provides type traits for working with templates.
T visit(T... args)
Hide me