SeqAn3
3.4.0-rc.3
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
16
#include <
seqan3/core/platform.hpp
>
17
18
namespace
seqan3
19
{
29
template
<
typename
stream_type,
typename
value_type>
30
concept
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) {
33
typename
std::remove_reference_t<stream_type>::char_type
;
34
typename
std::remove_reference_t<stream_type>::traits_type
;
35
typename
std::remove_reference_t<stream_type>::int_type
;
36
typename
std::remove_reference_t<stream_type>::pos_type
;
37
typename
std::remove_reference_t<stream_type>::off_type
;
38
39
{
40
os << val
41
} ->
std::same_as<std::basic_ostream<typename std::remove_reference_t<stream_type>::char_type
,
42
typename
std::remove_reference_t<stream_type>::traits_type
> &>;
43
};
44
45
template
<
typename
stream_type>
46
concept
output_stream =
requires
{
typename
std::remove_reference_t<stream_type>::char_type
; }
47
&&
output_stream_over<stream_type, typename std::remove_reference_t<stream_type>::char_type
>;
49
88
98
template
<
typename
stream_type,
typename
value_type>
99
concept
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) {
102
typename
std::remove_reference_t<stream_type>::char_type
;
103
typename
std::remove_reference_t<stream_type>::traits_type
;
104
typename
std::remove_reference_t<stream_type>::int_type
;
105
typename
std::remove_reference_t<stream_type>::pos_type
;
106
typename
std::remove_reference_t<stream_type>::off_type
;
107
108
{
109
is >> val
110
} ->
std::same_as<std::basic_istream<typename std::remove_reference_t<stream_type>::char_type
,
111
typename
std::remove_reference_t<stream_type>::traits_type
> &>;
112
};
113
114
template
<
typename
stream_type>
115
concept
input_stream =
requires
{
typename
std::remove_reference_t<stream_type>::char_type
; }
116
&&
input_stream_over<stream_type, typename std::remove_reference_t<stream_type>::char_type
>;
118
157
158
}
// namespace seqan3
input_stream_over
Concept for input streams.
output_stream_over
Concept for output streams.
iosfwd
seqan3
The main SeqAn3 namespace.
Definition
aligned_sequence_concept.hpp:26
platform.hpp
Provides platform and dependency checks.
std::remove_reference_t
std::tuple_size_v
T tuple_size_v
type_traits
Hide me
Version:
seqan3
io
stream
concept.hpp
Generated on Wed Apr 23 2025 13:22:40 for SeqAn3 by
1.9.8