Skip to content

Commit 0b74e47

Browse files
committed
fixup! WIP: [libc++][ranges] Implement ranges::stride_view.
Rebase to main.
1 parent 1949ba8 commit 0b74e47

File tree

2 files changed

+7
-2
lines changed

2 files changed

+7
-2
lines changed

libcxx/include/__ranges/stride_view.h

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@
1212

1313
#include <__assert>
1414
#include <__compare/three_way_comparable.h>
15+
#include <__concepts/constructible.h>
1516
#include <__concepts/convertible_to.h>
1617
#include <__concepts/derived_from.h>
1718
#include <__concepts/equality_comparable.h>
@@ -35,6 +36,8 @@
3536
#include <__ranges/range_adaptor.h>
3637
#include <__ranges/view_interface.h>
3738

39+
#include <__type_traits/make_unsigned.h>
40+
3841
#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
3942
# pragma GCC system_header
4043
#endif
@@ -395,7 +398,7 @@ struct __fn {
395398

396399
template <class _Np>
397400
[[nodiscard]] _LIBCPP_HIDE_FROM_ABI constexpr auto operator()(_Np&& __n) const {
398-
return __range_adaptor_closure_t(std::__bind_back(*this, std::forward<_Np>(__n)));
401+
return __pipeable(std::__bind_back(*this, std::forward<_Np>(__n)));
399402
}
400403
};
401404
} // namespace __stride_view

libcxx/test/std/ranges/range.adaptors/range.stride.view/concept.verify.cpp

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,9 @@
1818
#include "types.h"
1919

2020
template <typename I, std::ranges::range_difference_t<I> D>
21-
concept CanStrideView = requires { std::ranges::stride_view<I>{I{}, D}; };
21+
concept CanStrideView = requires {
22+
std::ranges::stride_view<I>{I{}, D};
23+
};
2224

2325
// Ensure that the InputRangeNotIndirectlyReadable is a valid range.
2426
static_assert(std::ranges::range<InputRangeNotIndirectlyReadable>);

0 commit comments

Comments
 (0)