SeqAn3  3.2.0-rc.1
The Modern C++ library for sequence analysis.
two_dimensional_matrix_iterator_concept.hpp
Go to the documentation of this file.
1 // -----------------------------------------------------------------------------------------------------
2 // Copyright (c) 2006-2022, Knut Reinert & Freie Universität Berlin
3 // Copyright (c) 2016-2022, 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 <concepts>
16 #include <iterator>
17 #include <type_traits>
18 
20 
21 namespace seqan3::detail
22 {
23 
93 template <typename iter_t>
94 concept two_dimensional_matrix_iterator =
95  std::random_access_iterator<iter_t>
96  && requires (std::remove_reference_t<iter_t> it, std::remove_reference_t<iter_t> const cit, matrix_offset offset) {
97  {
98  it += offset
99  };
100  {
101  it + offset
102  };
103  {
104  offset + it
105  };
106  {
107  cit + offset
108  };
109  {
110  offset + cit
111  };
112  {
113  it -= offset
114  };
115  {
116  it - offset
117  };
118  {
119  cit - offset
120  };
121  {
122  it.coordinate()
123  };
124  {
125  cit.coordinate()
126  };
127 
128  {
129  it += offset
130  } -> std::same_as<std::remove_reference_t<iter_t> &>;
131  {
132  it + offset
133  } -> std::same_as<std::remove_reference_t<iter_t>>;
134  {
135  offset + it
136  } -> std::same_as<std::remove_reference_t<iter_t>>;
137  {
138  it -= offset
139  } -> std::same_as<std::remove_reference_t<iter_t> &>;
140  {
141  it - offset
142  } -> std::same_as<std::remove_reference_t<iter_t>>;
143  {
144  cit - offset
145  } -> std::same_as<std::remove_reference_t<iter_t>>;
146  {
147  it.coordinate()
148  } -> std::same_as<matrix_coordinate>;
149  {
150  cit.coordinate()
151  } -> std::same_as<matrix_coordinate>;
152  };
154 } // namespace seqan3::detail
The <concepts> header from C++20's standard library.
requires requires
The rank_type of the semi-alphabet; defined as the return type of seqan3::to_rank....
Definition: alphabet/concept.hpp:164
@ offset
Sequence (seqan3::field::seq) relative start position (0-based), unsigned value.
Provides seqan3::detail::matrix_index, seqan3::detail::matrix_coordinate and associated strong types.