Skip to content

Commit

Permalink
some more updates
Browse files Browse the repository at this point in the history
  • Loading branch information
whaeck committed May 7, 2024
1 parent 3292329 commit 4932d9b
Show file tree
Hide file tree
Showing 4 changed files with 32 additions and 0 deletions.
14 changes: 14 additions & 0 deletions src/tools/std23/views/stride.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -245,6 +245,20 @@ struct stride_view : std20::ranges::view_interface< stride_view< R > > {

return -( right - left );
}

friend constexpr std20::ranges::range_rvalue_reference_t< Base >
iter_move( const iterator& iter ) noexcept(noexcept( std20::ranges::iter_move( iter.current_ ) ) ) {

return std20::ranges::iter_move( iter.current_ );
}

template < typename B = Base >
friend constexpr auto iter_swap( const iterator& left, const iterator& right )
noexcept(noexcept(std20::ranges::iter_swap( left.current_, right.current_ )))
-> std::enable_if_t<std20::ranges::indirectly_swappable< B > > {

std20::ranges::iter_swap( left.current_, right.current_ );
}
};

public:
Expand Down
6 changes: 6 additions & 0 deletions src/tools/std23/views/test/chunk.test.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,8 @@ SCENARIO( "chunk_view" ) {

THEN( "the chunk_view satisfies the required concepts" ) {

CHECK( std20::ranges::viewable_range< Range > );

CHECK( std20::ranges::range< Range > );
CHECK( std20::ranges::view< Range > );
CHECK( ! std20::ranges::sized_range< Range > );
Expand Down Expand Up @@ -70,6 +72,8 @@ SCENARIO( "chunk_view" ) {

THEN( "the chunk_view satisfies the required concepts" ) {

CHECK( std20::ranges::viewable_range< Range > );

CHECK( std20::ranges::range< Range > );
CHECK( std20::ranges::view< Range > );
CHECK( std20::ranges::sized_range< Range > );
Expand Down Expand Up @@ -122,6 +126,8 @@ SCENARIO( "chunk_view" ) {

THEN( "the chunk_view satisfies the required concepts" ) {

CHECK( std20::ranges::viewable_range< Range > );

CHECK( std20::ranges::range< Range > );
CHECK( std20::ranges::view< Range > );
CHECK( std20::ranges::sized_range< Range > );
Expand Down
6 changes: 6 additions & 0 deletions src/tools/std23/views/test/chunk_by.test.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,8 @@ SCENARIO( "chunk_by_view" ) {

THEN( "the chunk_by_view satisfies the required concepts" ) {

CHECK( std20::ranges::viewable_range< Range > );

CHECK( std20::ranges::range< Range > );
CHECK( std20::ranges::view< Range > );
CHECK( ! std20::ranges::sized_range< Range > );
Expand Down Expand Up @@ -75,6 +77,8 @@ SCENARIO( "chunk_by_view" ) {

THEN( "the chunk_by_view satisfies the required concepts" ) {

CHECK( std20::ranges::viewable_range< Range > );

CHECK( std20::ranges::range< Range > );
CHECK( std20::ranges::view< Range > );
CHECK( ! std20::ranges::sized_range< Range > );
Expand Down Expand Up @@ -137,6 +141,8 @@ SCENARIO( "chunk_by_view" ) {

THEN( "the chunk_by_view satisfies the required concepts" ) {

CHECK( std20::ranges::viewable_range< Range > );

CHECK( std20::ranges::range< Range > );
CHECK( std20::ranges::view< Range > );
CHECK( ! std20::ranges::sized_range< Range > );
Expand Down
6 changes: 6 additions & 0 deletions src/tools/std23/views/test/stride.test.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,8 @@ SCENARIO( "stride_view" ) {

THEN( "the stride_view satisfies the required concepts" ) {

CHECK( std20::ranges::viewable_range< Range > );

CHECK( std20::ranges::range< Range > );
CHECK( std20::ranges::view< Range > );
CHECK( ! std20::ranges::sized_range< Range > );
Expand Down Expand Up @@ -63,6 +65,8 @@ SCENARIO( "stride_view" ) {

THEN( "the stride_view satisfies the required concepts" ) {

CHECK( std20::ranges::viewable_range< Range > );

CHECK( std20::ranges::range< Range > );
CHECK( std20::ranges::view< Range > );
CHECK( std20::ranges::sized_range< Range > );
Expand Down Expand Up @@ -100,6 +104,8 @@ SCENARIO( "stride_view" ) {

THEN( "the stride_view satisfies the required concepts" ) {

CHECK( std20::ranges::viewable_range< Range > );

CHECK( std20::ranges::range< Range > );
CHECK( std20::ranges::view< Range > );
CHECK( std20::ranges::sized_range< Range > );
Expand Down

0 comments on commit 4932d9b

Please sign in to comment.