Skip to content

Commit

Permalink
Cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
whaeck committed May 14, 2024
1 parent 402009a commit 8ea6819
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions src/tools/std23/views/stride.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -286,7 +286,9 @@ struct stride_view : std20::ranges::view_interface< stride_view< R > > {
template < typename RR = R, std::enable_if_t< !std20::ranges::detail::simple_view< RR >, int> = 0>
constexpr iterator< false > end() {

if constexpr ( std20::ranges::common_range< R > && std20::ranges::sized_range< R > ) {
if constexpr ( std20::ranges::common_range< R > &&
std20::ranges::sized_range< R > &&
std20::ranges::forward_range< R > ) {

auto missing = ( this->stride_ - std20::ranges::distance( this->base_ ) % this->stride_ ) % this->stride_;
return iterator< false >( this, std20::ranges::end( this->base_ ), missing );
Expand All @@ -313,7 +315,7 @@ struct stride_view : std20::ranges::view_interface< stride_view< R > > {
}
else if constexpr ( std20::ranges::common_range< R > && ! std20::ranges::bidirectional_range< R >) {

return iterator< true >( this, std20::ranges::end( this->base_ ), 0 );
return iterator< true >( this, std20::ranges::end( this->base_ ) );
}
else {

Expand Down

0 comments on commit 8ea6819

Please sign in to comment.