SeqAn3 3.4.0-rc.1
The Modern C++ library for sequence analysis.
Loading...
Searching...
No Matches
io/stream/concept.hpp
Go to the documentation of this file.
1// SPDX-FileCopyrightText: 2006-2024 Knut Reinert & Freie Universität Berlin
2// SPDX-FileCopyrightText: 2016-2024 Knut Reinert & MPI für molekulare Genetik
3// SPDX-License-Identifier: BSD-3-Clause
4
10#pragma once
11
12#include <concepts>
13#include <iosfwd>
14#include <type_traits>
15
17
18namespace seqan3
19{
29template <typename stream_type, typename value_type>
30concept output_stream_over =
31 std::is_base_of_v<std::ios_base, std::remove_reference_t<stream_type>>
32 && requires (stream_type & os, value_type & val) {
38
39 {
40 os << val
41 } -> std::same_as<std::basic_ostream<typename std::remove_reference_t<stream_type>::char_type,
43 };
44
45template <typename stream_type>
46concept output_stream = requires { typename std::remove_reference_t<stream_type>::char_type; }
49
88
98template <typename stream_type, typename value_type>
99concept input_stream_over =
100 std::is_base_of_v<std::ios_base, std::remove_reference_t<stream_type>>
101 && requires (stream_type & is, value_type & val) {
107
108 {
109 is >> val
110 } -> std::same_as<std::basic_istream<typename std::remove_reference_t<stream_type>::char_type,
112 };
113
114template <typename stream_type>
115concept input_stream = requires { typename std::remove_reference_t<stream_type>::char_type; }
118
157
158} // namespace seqan3
Concept for input streams.
Concept for output streams.
The main SeqAn3 namespace.
Definition aligned_sequence_concept.hpp:26
Provides platform and dependency checks.
Hide me