SeqAn3 3.1.0
The Modern C++ library for sequence analysis.
concept.hpp
Go to the documentation of this file.
1// -----------------------------------------------------------------------------------------------------
2// Copyright (c) 2006-2021, Knut Reinert & Freie Universität Berlin
3// Copyright (c) 2016-2021, 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 <seqan3/std/ranges>
16
18
19namespace seqan3
20{
43template <typename type>
44SEQAN3_CONCEPT const_iterable_range =
45 std::ranges::input_range<std::remove_const_t<type>> &&
46 std::ranges::input_range<type const> &&
47 (std::ranges::forward_range<std::remove_const_t<type>> == std::ranges::forward_range<type const>) &&
48 (std::ranges::bidirectional_range<std::remove_const_t<type>> == std::ranges::bidirectional_range<type const>) &&
49 (std::ranges::random_access_range<std::remove_const_t<type>> == std::ranges::random_access_range<type const>);
51
84template <typename iterator_t>
85SEQAN3_CONCEPT pseudo_random_access_iterator =
86 std::forward_iterator<iterator_t> &&
89 std::totally_ordered<iterator_t> &&
90 std::sized_sentinel_for<iterator_t, iterator_t> &&
91 requires (iterator_t i, iterator_t const j, std::iter_difference_t<iterator_t> const n)
92{
93 std::same_as<decltype( i += n ), iterator_t &>;
94 std::same_as<decltype( j + n ), iterator_t>;
95 std::same_as<decltype( n + j ), iterator_t>;
96 std::same_as<decltype( --i ), iterator_t &>;
97 std::same_as<decltype( i-- ), iterator_t>;
98 std::same_as<decltype( i -= n ), iterator_t &>;
99 std::same_as<decltype( j - n ), iterator_t>;
100 std::same_as<decltype( j[n] ), std::iter_reference_t<iterator_t>>;
101};
103
120template <typename rng_t>
121SEQAN3_CONCEPT pseudo_random_access_range =
122 std::ranges::forward_range<rng_t> &&
125} // namespace seqan3
Specifies requirements of an input range type for which the const version of that type satisfies the ...
This concept checks if an iterator type models pseudo random access.
This concept checks if a type models a pseudo random access range.
T is_base_of_v
The main SeqAn3 namespace.
Definition: cigar_operation_table.hpp:2
Provides platform and dependency checks.
The <ranges> header from C++20's standard library.