@@ -260,17 +260,26 @@ struct iota_fn
260
260
static_assert (std::incrementable<Value>, " The Value type to radr::iota needs to satisfy std::incrementable." );
261
261
static_assert (weakly_equality_comparable_with<Value, Bound>,
262
262
" The Value type to radr::iota needs to be comparable with the Bound type." );
263
- static_assert (std::semiregular<Bound>, " The Bound type to radr::iota needs to satisfy std::regular ." );
263
+ static_assert (std::semiregular<Bound>, " The Bound type to radr::iota needs to satisfy std::semiregular ." );
264
264
265
- using It = detail::iota_iterator<Value>;
266
- using Sen = std::conditional_t <std::same_as<Value, Bound>, It, detail::iota_sentinel<Value, Bound>>;
265
+ using It = detail::iota_iterator<Value>;
266
+ if constexpr (std::same_as<Bound, std::unreachable_sentinel_t >)
267
+ {
268
+ return borrowing_rad<It, std::unreachable_sentinel_t , It, std::unreachable_sentinel_t >{
269
+ It{val},
270
+ std::unreachable_sentinel};
271
+ }
272
+ else
273
+ {
274
+ using Sen = std::conditional_t <std::same_as<Value, Bound>, It, detail::iota_sentinel<Value, Bound>>;
267
275
268
- constexpr borrowing_rad_kind kind =
269
- ((std::random_access_iterator<It> && std::same_as<It, Sen>) || std::sized_sentinel_for<Bound, Value>)
270
- ? borrowing_rad_kind::sized
271
- : borrowing_rad_kind::unsized;
276
+ constexpr borrowing_rad_kind kind =
277
+ ((std::random_access_iterator<It> && std::same_as<It, Sen>) || std::sized_sentinel_for<Bound, Value>)
278
+ ? borrowing_rad_kind::sized
279
+ : borrowing_rad_kind::unsized;
272
280
273
- return borrowing_rad<It, Sen, It, Sen, kind>{It{val}, Sen{bound}};
281
+ return borrowing_rad<It, Sen, It, Sen, kind>{It{val}, Sen{bound}};
282
+ }
274
283
}
275
284
};
276
285
0 commit comments