StormByte 2.0.0
C++26 foundation of the StormByte suite
 
Loading...
Searching...
No Matches
ranges.hxx
Go to the documentation of this file.
1/*
2 * Copyright (C) 2024-2026 David C. Manuelda (StormBytePP)
3 *
4 * This file is part of StormByte.
5 *
6 * StormByte original source is dual-licensed:
7 *
8 * 1. GNU Lesser General Public License v3.0 (or later)
9 * You may redistribute and/or modify this file under the terms of the
10 * GNU Lesser General Public License as published by the Free Software
11 * Foundation, either version 3 of the License, or (at your option)
12 * any later version.
13 *
14 * 2. Commercial license
15 * Alternatively, this file may be used under the terms of a commercial
16 * license agreement with the copyright holder
17 * (David C. Manuelda <StormByte@gmail.com>).
18 *
19 * Both licenses apply only to original StormByte source in this repository.
20 * They do not cover other StormByte modules or any third-party material
21 * shipped with this repository (including everything under thirdparty/),
22 * which remains under its own license.
23 *
24 * Neither license grants any patent rights. Any patent licenses required
25 * to use this software or third-party components must be obtained separately
26 * from the patent holders.
27 *
28 * StormByte is distributed in the hope that it will be useful,
29 * but WITHOUT ANY WARRANTY; without even the implied warranty of
30 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
31 * GNU Lesser General Public License for more details.
32 *
33 * You should have received a copy of the GNU Lesser General Public License
34 * version 3 along with StormByte. If not, see
35 * <https://www.gnu.org/licenses/lgpl-3.0.html>.
36 *
37 * SPDX-License-Identifier: LGPL-3.0-or-later OR LicenseRef-StormByte-Commercial
38 */
39
40#pragma once
41
44
45#include <cstddef>
46#include <iterator>
47#include <ranges>
48
53namespace StormByte {
58 namespace Type {
77 template<typename R>
78 concept Range = std::ranges::range<R>;
79
84 template<typename R>
85 concept InputRange = std::ranges::input_range<R>;
86
92 template<typename R, typename T>
93 concept OutputRange = std::ranges::output_range<R, T>;
94
99 template<typename R>
100 concept ForwardRange = std::ranges::forward_range<R>;
101
106 template<typename R>
107 concept BidirectionalRange = std::ranges::bidirectional_range<R>;
108
113 template<typename R>
114 concept RandomAccessRange = std::ranges::random_access_range<R>;
115
120 template<typename R>
121 concept ContiguousRange = std::ranges::contiguous_range<R>;
122
127 template<typename R>
128 concept SizedRange = std::ranges::sized_range<R>;
129
134 template<typename R>
135 concept CommonRange = std::ranges::common_range<R>;
136
141 template<typename R>
142 concept View = std::ranges::view<R>;
143
148 template<typename R>
149 concept BorrowedRange = std::ranges::borrowed_range<R>;
150
162 template<typename I>
163 concept InputIterator = std::input_iterator<I>;
164
170 template<typename I, typename T>
171 concept OutputIterator = std::output_iterator<I, T>;
172
177 template<typename I>
178 concept ForwardIterator = std::forward_iterator<I>;
179
184 template<typename I>
185 concept BidirectionalIterator = std::bidirectional_iterator<I>;
186
191 template<typename I>
192 concept RandomAccessIterator = std::random_access_iterator<I>;
193
198 template<typename I>
199 concept ContiguousIterator = std::contiguous_iterator<I>;
200
206 template<typename S, typename I>
207 concept SentinelFor = std::sentinel_for<S, I>;
208
214 template<typename S, typename I>
215 concept SizedSentinelFor = std::sized_sentinel_for<S, I>;
216
228 template<Range R>
229 using RangeValue = std::ranges::range_value_t<R>;
230
235 template<Range R>
236 using RangeReference = std::ranges::range_reference_t<R>;
237
242 template<Range R>
243 using RangeDifference = std::ranges::range_difference_t<R>;
244
249 template<typename I>
250 using IteratorValue = std::iter_value_t<I>;
251
265 template<typename R>
270
277 template<typename I>
282
285 }
286}
Bidirectional iterator (std::bidirectional_iterator).
Definition ranges.hxx:185
Bidirectional range (std::ranges::bidirectional_range).
Definition ranges.hxx:107
Borrowed range (std::ranges::borrowed_range).
Definition ranges.hxx:149
Input iterator whose scalar values can be explicitly converted to std::byte.
Definition ranges.hxx:278
Input range whose scalar values can be explicitly converted to std::byte.
Definition ranges.hxx:266
Class or struct type (not union, not enum).
Definition categories.hxx:294
Common range (std::ranges::common_range).
Definition ranges.hxx:135
Contiguous iterator (std::contiguous_iterator).
Definition ranges.hxx:199
Contiguous range (std::ranges::contiguous_range).
Definition ranges.hxx:121
From may be explicitly converted to To with static_cast.
Definition conversions.hxx:86
Forward iterator (std::forward_iterator).
Definition ranges.hxx:178
Forward range (std::ranges::forward_range).
Definition ranges.hxx:100
Input iterator (std::input_iterator).
Definition ranges.hxx:163
Input range (std::ranges::input_range).
Definition ranges.hxx:85
Output iterator for values of type T (std::output_iterator).
Definition ranges.hxx:171
Output range for values of type T (std::ranges::output_range).
Definition ranges.hxx:93
Random-access iterator (std::random_access_iterator).
Definition ranges.hxx:192
Random-access range (std::ranges::random_access_range).
Definition ranges.hxx:114
Valid range (std::ranges::range).
Definition ranges.hxx:78
Valid sentinel for an iterator (std::sentinel_for).
Definition ranges.hxx:207
Sized range (std::ranges::sized_range).
Definition ranges.hxx:128
Sized sentinel for an iterator (std::sized_sentinel_for).
Definition ranges.hxx:215
Range view (std::ranges::view).
Definition ranges.hxx:142
std::iter_value_t< I > IteratorValue
Value type associated with an iterator.
Definition ranges.hxx:250
std::ranges::range_difference_t< R > RangeDifference
Difference type associated with a valid range.
Definition ranges.hxx:243
std::ranges::range_value_t< R > RangeValue
Value type of a valid range.
Definition ranges.hxx:229
std::ranges::range_reference_t< R > RangeReference
Reference type produced by a valid range.
Definition ranges.hxx:236
Root namespace of the StormByte suite.
Octet count. Defined in byte_size.hxx. Forwarded so Type::Numeral can name it.