StormByte C++ Library 1.2.0
StormByte is a comprehensive, cross-platform C++ library aimed at easing system programming, configuration management, logging, and database handling tasks. This library provides a unified API that abstracts away the complexities and inconsistencies of different platforms (Windows, Linux).
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 is free software: you can redistribute it and/or modify
7 * it under the terms of the GNU Lesser General Public License version 3
8 * or later, as published by the Free Software Foundation.
9 *
10 * StormByte is distributed in the hope that it will be useful,
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 * GNU Lesser General Public License for more details.
14 *
15 * You should have received a copy of the GNU Lesser General Public License
16 * along with StormByte. If not, see
17 * <https://www.gnu.org/licenses/lgpl-3.0.html>.
18 */
19
20#pragma once
21
22// ByteInputRange/ByteInputIterator use Class and ExplicitlyConvertibleTo:
23// must come after categories.hxx and conversions.hxx.
26
27#include <cstddef>
28#include <iterator>
29#include <ranges>
30
35namespace StormByte {
36 namespace Type {
47 template<typename R>
48 concept Range = std::ranges::range<R>;
49
51 template<typename R>
52 concept InputRange = std::ranges::input_range<R>;
53
55 template<typename R, typename T>
56 concept OutputRange = std::ranges::output_range<R, T>;
57
59 template<typename R>
60 concept ForwardRange = std::ranges::forward_range<R>;
61
63 template<typename R>
64 concept BidirectionalRange = std::ranges::bidirectional_range<R>;
65
67 template<typename R>
68 concept RandomAccessRange = std::ranges::random_access_range<R>;
69
71 template<typename R>
72 concept ContiguousRange = std::ranges::contiguous_range<R>;
73
75 template<typename R>
76 concept SizedRange = std::ranges::sized_range<R>;
77
79 template<typename R>
80 concept CommonRange = std::ranges::common_range<R>;
81
83 template<typename R>
84 concept View = std::ranges::view<R>;
85
87 template<typename R>
88 concept BorrowedRange = std::ranges::borrowed_range<R>;
89
91 template<typename I>
92 concept InputIterator = std::input_iterator<I>;
93
95 template<typename I, typename T>
96 concept OutputIterator = std::output_iterator<I, T>;
97
99 template<typename I>
100 concept ForwardIterator = std::forward_iterator<I>;
101
103 template<typename I>
104 concept BidirectionalIterator = std::bidirectional_iterator<I>;
105
107 template<typename I>
108 concept RandomAccessIterator = std::random_access_iterator<I>;
109
111 template<typename I>
112 concept ContiguousIterator = std::contiguous_iterator<I>;
113
115 template<typename S, typename I>
116 concept SentinelFor = std::sentinel_for<S, I>;
117
119 template<typename S, typename I>
120 concept SizedSentinelFor = std::sized_sentinel_for<S, I>;
121
123 template<Range R>
124 using RangeValue = std::ranges::range_value_t<R>;
125
127 template<Range R>
128 using RangeReference = std::ranges::range_reference_t<R>;
129
131 template<Range R>
132 using RangeDifference = std::ranges::range_difference_t<R>;
133
135 template<typename I>
136 using IteratorValue = std::iter_value_t<I>;
137
144 template<typename R>
149
156 template<typename I>
162 }
163}
Bidirectional iterator (std::bidirectional_iterator).
Definition ranges.hxx:104
Bidirectional range (std::ranges::bidirectional_range).
Definition ranges.hxx:64
Borrowed range (std::ranges::borrowed_range).
Definition ranges.hxx:88
Input iterator whose scalar values can be explicitly converted to std::byte.
Definition ranges.hxx:157
Input range whose scalar values can be explicitly converted to std::byte.
Definition ranges.hxx:145
Class or struct type (not union, not enum).
Definition categories.hxx:216
Common range (std::ranges::common_range).
Definition ranges.hxx:80
Contiguous iterator (std::contiguous_iterator).
Definition ranges.hxx:112
Contiguous range (std::ranges::contiguous_range).
Definition ranges.hxx:72
From may be explicitly converted to To with static_cast.
Definition conversions.hxx:57
Forward iterator (std::forward_iterator).
Definition ranges.hxx:100
Forward range (std::ranges::forward_range).
Definition ranges.hxx:60
Input iterator (std::input_iterator).
Definition ranges.hxx:92
Input range (std::ranges::input_range).
Definition ranges.hxx:52
Output iterator for values of type T (std::output_iterator).
Definition ranges.hxx:96
Output range for values of type T (std::ranges::output_range).
Definition ranges.hxx:56
Random-access iterator (std::random_access_iterator).
Definition ranges.hxx:108
Random-access range (std::ranges::random_access_range).
Definition ranges.hxx:68
Valid range (std::ranges::range).
Definition ranges.hxx:48
Valid sentinel for an iterator (std::sentinel_for).
Definition ranges.hxx:116
Sized range (std::ranges::sized_range).
Definition ranges.hxx:76
Sized sentinel for an iterator (std::sized_sentinel_for).
Definition ranges.hxx:120
Range view (std::ranges::view).
Definition ranges.hxx:84
std::iter_value_t< I > IteratorValue
Value type associated with an iterator.
Definition ranges.hxx:136
std::ranges::range_difference_t< R > RangeDifference
Difference type associated with a valid range.
Definition ranges.hxx:132
std::ranges::range_value_t< R > RangeValue
Value type of a valid range.
Definition ranges.hxx:124
std::ranges::range_reference_t< R > RangeReference
Reference type produced by a valid range.
Definition ranges.hxx:128
Root namespace of the StormByte suite.