SeqAn3  3.2.0
The Modern C++ library for sequence analysis.
optional.hpp
Go to the documentation of this file.
1 // -----------------------------------------------------------------------------------------------------
2 // Copyright (c) 2006-2022, Knut Reinert & Freie Universität Berlin
3 // Copyright (c) 2016-2022, 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 <optional>
16 
20 
21 namespace seqan3
22 {
32 template <typename char_t>
34 {
35  s << "<VALUELESS_OPTIONAL>";
36  return s;
37 }
38 
45 template <typename char_t, typename optional_type>
46  requires detail::is_type_specialisation_of_v<std::remove_cvref_t<optional_type>, std::optional>
47 inline debug_stream_type<char_t> & operator<<(debug_stream_type<char_t> & s, optional_type && arg)
48 {
49  if (arg.has_value())
50  s << *arg;
51  else
52  s << "<VALUELESS_OPTIONAL>";
53  return s;
54 }
55 
57 
58 } // namespace seqan3
Provides various type traits on generic types.
A "pretty printer" for most SeqAn data structures and related types.
Definition: debug_stream_type.hpp:78
Provides seqan3::debug_stream and related types.
requires requires
The rank_type of the semi-alphabet; defined as the return type of seqan3::to_rank....
Definition: alphabet/concept.hpp:164
The main SeqAn3 namespace.
Definition: aligned_sequence_concept.hpp:29
requires detail::debug_stream_range_guard< alignment_matrix_t > &&detail::matrix< alignment_matrix_t > debug_stream_type< char_t > & operator<<(debug_stream_type< char_t > &s, alignment_matrix_t &&matrix)
This is an overloaded member function, provided for convenience. It differs from the above function o...
Definition: debug_matrix.hpp:496
Provides type traits for working with templates.