Loading...
Searching...
No Matches
variant.hpp
Go to the documentation of this file.
// SPDX-FileCopyrightText: 2006-2025 Knut Reinert & Freie Universität Berlin
// SPDX-FileCopyrightText: 2016-2025 Knut Reinert & MPI für molekulare Genetik
// SPDX-License-Identifier: BSD-3-Clause
#pragma once
#include <variant>
#include <seqan3/core/debug_stream/debug_stream_type.hpp>
#include <seqan3/core/detail/template_inspection.hpp>
#include <seqan3/utility/type_traits/basic.hpp>
namespace seqan3
{
template <typename... variant_ts>
struct std_variant_printer<std::variant<variant_ts...>>
{
template <typename stream_t, typename arg_t>
constexpr void operator()(stream_t & stream, arg_t && arg) const
{
if (!arg.valueless_by_exception())
std::visit(
[&stream](auto && elem)
{
stream << elem;
},
arg);
else
stream << "<VALUELESS_VARIANT>";
}
};
} // 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