Loading...
Searching...
No Matches
io/stream/concept.hpp
Go to the documentation of this file.
// SPDX-FileCopyrightText: 2006-2025 Knut Reinert & Freie Universität Berlin
// SPDX-FileCopyrightText: 2016-2025 Knut Reinert & MPI für molekulare Genetik
// SPDX-License-Identifier: BSD-3-Clause
#pragma once
#include <concepts>
#include <iosfwd>
#include <type_traits>
#include <seqan3/core/platform.hpp>
namespace seqan3
{
template <typename stream_type, typename value_type>
concept output_stream_over =
std::is_base_of_v<std::ios_base, std::remove_reference_t<stream_type>>
&& requires (stream_type & os, value_type & val) {
typename std::remove_reference_t<stream_type>::char_type;
typename std::remove_reference_t<stream_type>::traits_type;
typename std::remove_reference_t<stream_type>::int_type;
typename std::remove_reference_t<stream_type>::pos_type;
typename std::remove_reference_t<stream_type>::off_type;
{
os << val
} -> std::same_as<std::basic_ostream<typename std::remove_reference_t<stream_type>::char_type,
typename std::remove_reference_t<stream_type>::traits_type> &>;
};
template <typename stream_type>
concept output_stream = requires { typename std::remove_reference_t<stream_type>::char_type; }
&& output_stream_over<stream_type, typename std::remove_reference_t<stream_type>::char_type>;
template <typename stream_type, typename value_type>
concept input_stream_over =
std::is_base_of_v<std::ios_base, std::remove_reference_t<stream_type>>
&& requires (stream_type & is, value_type & val) {
typename std::remove_reference_t<stream_type>::char_type;
typename std::remove_reference_t<stream_type>::traits_type;
typename std::remove_reference_t<stream_type>::int_type;
typename std::remove_reference_t<stream_type>::pos_type;
typename std::remove_reference_t<stream_type>::off_type;
{
is >> val
} -> std::same_as<std::basic_istream<typename std::remove_reference_t<stream_type>::char_type,
typename std::remove_reference_t<stream_type>::traits_type> &>;
};
template <typename stream_type>
concept input_stream = requires { typename std::remove_reference_t<stream_type>::char_type; }
&& input_stream_over<stream_type, typename std::remove_reference_t<stream_type>::char_type>;
} // namespace seqan3
input_stream_over
Concept for input streams.
output_stream_over
Concept for output streams.
iosfwd
std::is_base_of_v
T is_base_of_v
seqan3
The main SeqAn3 namespace.
Definition aligned_sequence_concept.hpp:26
platform.hpp
Provides platform and dependency checks.
std::remove_reference_t
type_traits
Hide me