SeqAn3  3.2.0
The Modern C++ library for sequence analysis.
io/stream/concept.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 <concepts>
16 #include <iosfwd>
17 #include <type_traits>
18 
19 #include <seqan3/core/platform.hpp>
20 
21 namespace seqan3
22 {
32 template <typename stream_type, typename value_type>
33 concept output_stream_over =
34  std::is_base_of_v<std::ios_base, std::remove_reference_t<stream_type>>
35  && requires (stream_type & os, value_type & val) {
41 
42  {
43  os << val
44  } -> std::same_as<std::basic_ostream<typename std::remove_reference_t<stream_type>::char_type,
46  };
47 
48 template <typename stream_type>
49 concept output_stream = requires { typename std::remove_reference_t<stream_type>::char_type; }
52 
91 
101 template <typename stream_type, typename value_type>
102 concept input_stream_over =
103  std::is_base_of_v<std::ios_base, std::remove_reference_t<stream_type>>
104  && requires (stream_type & is, value_type & val) {
110 
111  {
112  is >> val
113  } -> std::same_as<std::basic_istream<typename std::remove_reference_t<stream_type>::char_type,
115  };
116 
117 template <typename stream_type>
118 concept input_stream = requires { typename std::remove_reference_t<stream_type>::char_type; }
121 
160 
161 } // namespace seqan3
The <concepts> header from C++20's standard library.
requires requires
The rank_type of the semi-alphabet; defined as the return type of seqan3::to_rank....
Definition: alphabet/concept.hpp:164
Concept for input streams.
Concept for output streams.
The main SeqAn3 namespace.
Definition: aligned_sequence_concept.hpp:29
Provides platform and dependency checks.