From 7c8d85761254dbeb5a00b0b6c59f78eccc4b31bb Mon Sep 17 00:00:00 2001 From: Mateusz Jakub Fila <37295697+m-fila@users.noreply.github.com> Date: Fri, 17 Jan 2025 15:20:54 +0100 Subject: [PATCH] Remove iterator-testing code redundant in C++20 (#726) * remove redundant check for at least C++20 * remove test for requirement that is no longer required in C++20 --- doc/collections_as_container.md | 1 - tests/unittests/std_interoperability.cpp | 7 ------- 2 files changed, 8 deletions(-) diff --git a/doc/collections_as_container.md b/doc/collections_as_container.md index 233918d57..860d21b8a 100644 --- a/doc/collections_as_container.md +++ b/doc/collections_as_container.md @@ -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 | | diff --git a/tests/unittests/std_interoperability.cpp b/tests/unittests/std_interoperability.cpp index 8f34376bf..8d49e0e5e 100644 --- a/tests/unittests/std_interoperability.cpp +++ b/tests/unittests/std_interoperability.cpp @@ -561,11 +561,6 @@ TEST_CASE("Collection iterators", "[collection][container][iterator][std]") { // const_iterator STATIC_REQUIRE(std::is_swappable_v); - // std::iterator_traits::value_type (required prior to C++20) - // iterator - STATIC_REQUIRE(traits::has_value_type_v>); - // const_iterator - STATIC_REQUIRE(traits::has_value_type_v>); // std::iterator_traits::difference_type // iterator STATIC_REQUIRE(traits::has_difference_type_v>); @@ -1030,9 +1025,7 @@ TEST_CASE("Collection and std iterator adaptors", "[collection][container][adapt STATIC_REQUIRE(traits::has_iterator_v); STATIC_REQUIRE(traits::has_iterator_category_v>); STATIC_REQUIRE(std::is_base_of_v::iterator_category>); -#if (__cplusplus >= 202002L) STATIC_REQUIRE(std::input_iterator); -#endif STATIC_REQUIRE(std::is_same_v::reference>); }