SeqAn3
3.4.0
The Modern C++ library for sequence analysis.
Toggle main menu visibility
Loading...
Searching...
No Matches
optional.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 <
optional
>
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
23
template
<>
24
struct
optional_printer
<
std
::nullopt_t>
25
{
31
template
<
typename
stream_t>
32
constexpr
void
operator()
(stream_t & stream,
std::nullopt_t
const
SEQAN3_DOXYGEN_ONLY(arg))
const
33
{
34
stream <<
"<VALUELESS_OPTIONAL>"
;
35
}
36
};
37
42
template
<
typename
T>
43
struct
optional_printer
<
std
::optional<T>>
44
{
51
template
<
typename
stream_t,
typename
arg_t>
52
constexpr
void
operator()
(stream_t & stream, arg_t && arg)
const
53
{
54
if
(arg.has_value())
55
stream << *arg;
56
else
57
stream <<
"<VALUELESS_OPTIONAL>"
;
58
}
59
};
60
61
}
// 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.
std::nullopt_t
optional
seqan3::optional_printer< std::nullopt_t >::operator()
constexpr void operator()(stream_t &stream, std::nullopt_t const arg) const
Prints std::nullopt_t to formatted output stream.
Definition
optional.hpp:32
seqan3::optional_printer< std::optional< T > >::operator()
constexpr void operator()(stream_t &stream, arg_t &&arg) const
Print the optional to the stream by printing its value or nothing if valueless.
Definition
optional.hpp:52
seqan3::optional_printer
Definition
default_printer.hpp:40
template_inspection.hpp
Provides type traits for working with templates.
Hide me
Version:
seqan3
core
debug_stream
optional.hpp
Generated on
for SeqAn3 by
1.17.0