Skip to content

Commit 2d330a6

Browse files
committed
Use num::integral rather than std::integral...
...in function arguments, because I don't think flux::chunk(seq, 'a') is something we should allow.
1 parent f54267a commit 2d330a6

File tree

9 files changed

+19
-19
lines changed

9 files changed

+19
-19
lines changed

include/flux/core/inline_sequence_base.hpp

+6-6
Original file line numberDiff line numberDiff line change
@@ -235,7 +235,7 @@ struct inline_sequence_base {
235235
(multipass_sequence<Derived> && not infinite_sequence<Derived>);
236236

237237
[[nodiscard]]
238-
constexpr auto chunk(std::integral auto chunk_sz) &&;
238+
constexpr auto chunk(num::integral auto chunk_sz) &&;
239239

240240
template <typename Pred>
241241
requires multipass_sequence<Derived> &&
@@ -251,15 +251,15 @@ struct inline_sequence_base {
251251
requires infinite_sequence<Derived> || multipass_sequence<Derived>;
252252

253253
[[nodiscard]]
254-
constexpr auto cycle(std::integral auto count) && requires multipass_sequence<Derived>;
254+
constexpr auto cycle(num::integral auto count) && requires multipass_sequence<Derived>;
255255

256256
[[nodiscard]]
257257
constexpr auto dedup() &&
258258
requires multipass_sequence<Derived> &&
259259
std::equality_comparable<element_t<Derived>>;
260260

261261
[[nodiscard]]
262-
constexpr auto drop(std::integral auto count) &&;
262+
constexpr auto drop(num::integral auto count) &&;
263263

264264
template <typename Pred>
265265
requires std::predicate<Pred&, element_t<Derived>>
@@ -338,7 +338,7 @@ struct inline_sequence_base {
338338
constexpr auto scan_first(Func func) &&;
339339

340340
[[nodiscard]]
341-
constexpr auto slide(std::integral auto win_sz) && requires multipass_sequence<Derived>;
341+
constexpr auto slide(num::integral auto win_sz) && requires multipass_sequence<Derived>;
342342

343343
template <typename Pattern>
344344
requires multipass_sequence<Derived> &&
@@ -364,10 +364,10 @@ struct inline_sequence_base {
364364
constexpr auto split_string(Pattern&& pattern) &&;
365365

366366
[[nodiscard]]
367-
constexpr auto stride(std::integral auto by) &&;
367+
constexpr auto stride(num::integral auto by) &&;
368368

369369
[[nodiscard]]
370-
constexpr auto take(std::integral auto count) &&;
370+
constexpr auto take(num::integral auto count) &&;
371371

372372
template <typename Pred>
373373
requires std::predicate<Pred&, element_t<Derived>>

include/flux/op/chunk.hpp

+2-2
Original file line numberDiff line numberDiff line change
@@ -298,7 +298,7 @@ struct chunk_adaptor<Base> : inline_sequence_base<chunk_adaptor<Base>> {
298298
struct chunk_fn {
299299
template <adaptable_sequence Seq>
300300
[[nodiscard]]
301-
constexpr auto operator()(Seq&& seq, std::integral auto chunk_sz) const
301+
constexpr auto operator()(Seq&& seq, num::integral auto chunk_sz) const
302302
-> sequence auto
303303
{
304304
FLUX_ASSERT(chunk_sz > 0);
@@ -312,7 +312,7 @@ struct chunk_fn {
312312
FLUX_EXPORT inline constexpr auto chunk = detail::chunk_fn{};
313313

314314
template <typename D>
315-
constexpr auto inline_sequence_base<D>::chunk(std::integral auto chunk_sz) &&
315+
constexpr auto inline_sequence_base<D>::chunk(num::integral auto chunk_sz) &&
316316
{
317317
return flux::chunk(std::move(derived()), chunk_sz);
318318
}

include/flux/op/cycle.hpp

+2-2
Original file line numberDiff line numberDiff line change
@@ -225,7 +225,7 @@ struct cycle_fn {
225225
template <adaptable_sequence Seq>
226226
requires multipass_sequence<Seq>
227227
[[nodiscard]]
228-
constexpr auto operator()(Seq&& seq, std::integral auto count) const
228+
constexpr auto operator()(Seq&& seq, num::integral auto count) const
229229
-> multipass_sequence auto
230230
{
231231
auto c = num::checked_cast<distance_t>(count);
@@ -249,7 +249,7 @@ constexpr auto inline_sequence_base<D>::cycle() &&
249249
}
250250

251251
template <typename D>
252-
constexpr auto inline_sequence_base<D>::cycle(std::integral auto count) &&
252+
constexpr auto inline_sequence_base<D>::cycle(num::integral auto count) &&
253253
requires multipass_sequence<D>
254254
{
255255
return flux::cycle(std::move(derived()), count);

include/flux/op/drop.hpp

+2-2
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@ struct drop_adaptor : inline_sequence_base<drop_adaptor<Base>> {
6464
struct drop_fn {
6565
template <adaptable_sequence Seq>
6666
[[nodiscard]]
67-
constexpr auto operator()(Seq&& seq, std::integral auto count) const
67+
constexpr auto operator()(Seq&& seq, num::integral auto count) const
6868
{
6969
auto count_ = num::checked_cast<distance_t>(count);
7070
if (count_ < 0) {
@@ -81,7 +81,7 @@ struct drop_fn {
8181
FLUX_EXPORT inline constexpr auto drop = detail::drop_fn{};
8282

8383
template <typename Derived>
84-
constexpr auto inline_sequence_base<Derived>::drop(std::integral auto count) &&
84+
constexpr auto inline_sequence_base<Derived>::drop(num::integral auto count) &&
8585
{
8686
return flux::drop(std::move(derived()), count);
8787
}

include/flux/op/slide.hpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -128,7 +128,7 @@ struct slide_fn {
128128
FLUX_EXPORT inline constexpr auto slide = detail::slide_fn{};
129129

130130
template <typename D>
131-
constexpr auto inline_sequence_base<D>::slide(std::integral auto win_sz) &&
131+
constexpr auto inline_sequence_base<D>::slide(num::integral auto win_sz) &&
132132
requires multipass_sequence<D>
133133
{
134134
FLUX_ASSERT(win_sz > 0);

include/flux/op/stride.hpp

+2-2
Original file line numberDiff line numberDiff line change
@@ -254,7 +254,7 @@ struct stride_adaptor<Base> : inline_sequence_base<stride_adaptor<Base>> {
254254
struct stride_fn {
255255
template <adaptable_sequence Seq>
256256
[[nodiscard]]
257-
constexpr auto operator()(Seq&& seq, std::integral auto by) const
257+
constexpr auto operator()(Seq&& seq, num::integral auto by) const
258258
{
259259
FLUX_ASSERT(by > 0);
260260
return stride_adaptor<std::decay_t<Seq>>(FLUX_FWD(seq),
@@ -267,7 +267,7 @@ struct stride_fn {
267267
FLUX_EXPORT inline constexpr auto stride = detail::stride_fn{};
268268

269269
template <typename D>
270-
constexpr auto inline_sequence_base<D>::stride(std::integral auto by) &&
270+
constexpr auto inline_sequence_base<D>::stride(num::integral auto by) &&
271271
{
272272
return flux::stride(std::move(derived()), by);
273273
}

include/flux/op/take.hpp

+2-2
Original file line numberDiff line numberDiff line change
@@ -148,7 +148,7 @@ struct take_adaptor : inline_sequence_base<take_adaptor<Base>>
148148
struct take_fn {
149149
template <adaptable_sequence Seq>
150150
[[nodiscard]]
151-
constexpr auto operator()(Seq&& seq, std::integral auto count) const
151+
constexpr auto operator()(Seq&& seq, num::integral auto count) const
152152
{
153153
auto count_ = num::checked_cast<distance_t>(count);
154154
if (count_ < 0) {
@@ -164,7 +164,7 @@ struct take_fn {
164164
FLUX_EXPORT inline constexpr auto take = detail::take_fn{};
165165

166166
template <typename Derived>
167-
constexpr auto inline_sequence_base<Derived>::take(std::integral auto count) &&
167+
constexpr auto inline_sequence_base<Derived>::take(num::integral auto count) &&
168168
{
169169
return flux::take(std::move(derived()), count);
170170
}

include/flux/source/array_ptr.hpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -158,7 +158,7 @@ namespace detail {
158158
struct make_array_ptr_unchecked_fn {
159159
template <typename T>
160160
requires (std::is_object_v<T> && !std::is_abstract_v<T>)
161-
constexpr auto operator()(T* ptr, std::integral auto size) const -> array_ptr<T>
161+
constexpr auto operator()(T* ptr, num::integral auto size) const -> array_ptr<T>
162162
{
163163
return array_ptr<T>(ptr, num::checked_cast<distance_t>(size));
164164
}

include/flux/source/repeat.hpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -125,7 +125,7 @@ struct repeat_fn {
125125

126126
template <typename T>
127127
requires std::movable<std::decay_t<T>>
128-
constexpr auto operator()(T&& obj, std::integral auto count) const
128+
constexpr auto operator()(T&& obj, num::integral auto count) const
129129
{
130130
auto c = num::checked_cast<distance_t>(count);
131131
if (c < 0) {

0 commit comments

Comments
 (0)