SeqAn3
3.3.0
The Modern C++ library for sequence analysis.
Loading...
Searching...
No Matches
variant.hpp
Go to the documentation of this file.
1
// -----------------------------------------------------------------------------------------------------
2
// Copyright (c) 2006-2023, Knut Reinert & Freie Universität Berlin
3
// Copyright (c) 2016-2023, Knut Reinert & MPI für molekulare Genetik
4
// This file may be used, modified and/or redistributed under the terms of the 3-clause BSD-License
5
// shipped with this file and also available at: https://github.com/seqan/seqan3/blob/master/LICENSE.md
6
// -----------------------------------------------------------------------------------------------------
7
13
#pragma once
14
15
#include <
variant
>
16
17
#include <
seqan3/core/debug_stream/debug_stream_type.hpp
>
18
#include <
seqan3/core/detail/template_inspection.hpp
>
19
#include <
seqan3/utility/type_traits/basic.hpp
>
20
21
namespace
seqan3
22
{
36
template
<
typename
char
_t,
typename
variant_type>
37
requires
detail::is_type_specialisation_of_v<std::remove_cvref_t<variant_type>,
std::variant
>
38
inline
debug_stream_type<char_t>
&
operator<<
(
debug_stream_type<char_t>
& s, variant_type && v)
39
{
40
if
(!v.valueless_by_exception())
41
std::visit
(
42
[&s](
auto
&& arg)
43
{
44
s << arg;
45
},
46
v);
47
else
48
s <<
"<VALUELESS_VARIANT>"
;
49
return
s;
50
}
51
53
54
}
// namespace seqan3
basic.hpp
Provides various type traits on generic types.
seqan3::debug_stream_type
A "pretty printer" for most SeqAn data structures and related types.
Definition
debug_stream_type.hpp:78
debug_stream_type.hpp
Provides seqan3::debug_stream and related types.
seqan3::operator<<
debug_stream_type< char_t > & operator<<(debug_stream_type< char_t > &stream, alignment_t &&alignment)
Stream operator for alignments, which are represented as tuples of aligned sequences.
Definition
debug_stream_alignment.hpp:110
seqan3
The main SeqAn3 namespace.
Definition
aligned_sequence_concept.hpp:29
template_inspection.hpp
Provides type traits for working with templates.
variant
std::visit
T visit(T... args)
seqan3
core
debug_stream
variant.hpp
Generated on Wed Nov 13 2024 22:55:00 for SeqAn3 by
1.9.8