Skip to content

Commit

Permalink
Remove iterator-testing code redundant in C++20 (#726)
Browse files Browse the repository at this point in the history
* remove redundant check for at least C++20

* remove test for requirement that is no longer required in C++20
  • Loading branch information
m-fila authored Jan 17, 2025
1 parent a9c609e commit 7c8d857
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 8 deletions.
1 change: 0 additions & 1 deletion doc/collections_as_container.md
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,6 @@ In the following tables a convention from `Collection` is used: `iterator` stand
| [*CopyAssignable*](https://en.cppreference.com/w/cpp/named_req/CopyAssignable) | ✔️ yes / ✔️ yes | |
| [*Destructible*](https://en.cppreference.com/w/cpp/named_req/Destructible) | ✔️ yes / ✔️ yes | |
| [*Swappable*](https://en.cppreference.com/w/cpp/named_req/Swappable) | ✔️ yes / ✔️ yes | |
| `std::iterator_traits::value_type` (Until C++20 ) | ✔️ yes / ✔️ yes | |
| `std::iterator_traits::difference_type` | ✔️ yes / ✔️ yes | |
| `std::iterator_traits::reference` | ✔️ yes / ✔️ yes | |
| `std::iterator_traits::pointer` | ✔️ yes / ✔️ yes | |
Expand Down
7 changes: 0 additions & 7 deletions tests/unittests/std_interoperability.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -561,11 +561,6 @@ TEST_CASE("Collection iterators", "[collection][container][iterator][std]") {
// const_iterator
STATIC_REQUIRE(std::is_swappable_v<const_iterator&>);

// std::iterator_traits<It>::value_type (required prior to C++20)
// iterator
STATIC_REQUIRE(traits::has_value_type_v<std::iterator_traits<iterator>>);
// const_iterator
STATIC_REQUIRE(traits::has_value_type_v<std::iterator_traits<const_iterator>>);
// std::iterator_traits<It>::difference_type
// iterator
STATIC_REQUIRE(traits::has_difference_type_v<std::iterator_traits<iterator>>);
Expand Down Expand Up @@ -1030,9 +1025,7 @@ TEST_CASE("Collection and std iterator adaptors", "[collection][container][adapt
STATIC_REQUIRE(traits::has_iterator_v<CollectionType>);
STATIC_REQUIRE(traits::has_iterator_category_v<std::iterator_traits<const_iterator>>);
STATIC_REQUIRE(std::is_base_of_v<std::input_iterator_tag, std::iterator_traits<const_iterator>::iterator_category>);
#if (__cplusplus >= 202002L)
STATIC_REQUIRE(std::input_iterator<const_iterator>);
#endif
STATIC_REQUIRE(std::is_same_v<const_iterator::reference, std::move_iterator<const_iterator>::reference>);
}

Expand Down

0 comments on commit 7c8d857

Please sign in to comment.