Loading...
Searching...
No Matches
utility/range/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 <ranges>
#include <seqan3/core/platform.hpp>
namespace seqan3
{
template <typename type>
concept const_iterable_range =
std::ranges::input_range<std::remove_const_t<type>> && std::ranges::input_range<type const>
&& (std::ranges::forward_range<std::remove_const_t<type>> == std::ranges::forward_range<type const>)
&& (std::ranges::bidirectional_range<std::remove_const_t<type>> == std::ranges::bidirectional_range<type const>)
&& (std::ranges::random_access_range<std::remove_const_t<type>> == std::ranges::random_access_range<type const>);
template <typename iterator_t>
concept pseudo_random_access_iterator =
std::forward_iterator<iterator_t>
&& !std::is_base_of_v<std::random_access_iterator_tag, typename std::iterator_traits<iterator_t>::iterator_category>
&& std::totally_ordered<iterator_t> && std::sized_sentinel_for<iterator_t, iterator_t>
&& requires (iterator_t i, iterator_t const j, std::iter_difference_t<iterator_t> const n) {
requires std::same_as<decltype(i += n), iterator_t &>;
requires std::same_as<decltype(j + n), iterator_t>;
requires std::same_as<decltype(n + j), iterator_t>;
requires std::same_as<decltype(--i), iterator_t &>;
requires std::same_as<decltype(i--), iterator_t>;
requires std::same_as<decltype(i -= n), iterator_t &>;
requires std::same_as<decltype(j - n), iterator_t>;
requires std::same_as<decltype(j[n]), std::iter_reference_t<iterator_t>>;
};
template <typename rng_t>
concept pseudo_random_access_range =
std::ranges::forward_range<rng_t> && pseudo_random_access_iterator<std::ranges::iterator_t<rng_t>>;
} // namespace seqan3
const_iterable_range
Specifies requirements of an input range type for which the const version of that type satisfies the ...
pseudo_random_access_iterator
This concept checks if an iterator type models pseudo random access.
pseudo_random_access_range
This concept checks if a type models a pseudo random access range.
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_const_t
Hide me