diff --git a/doc/collections_as_container.md b/doc/collections_as_container.md index 338fb24aa..758b77b36 100644 --- a/doc/collections_as_container.md +++ b/doc/collections_as_container.md @@ -167,8 +167,8 @@ In addition to the *LegacyForwardIterator* the C++ standard specifies also the * | `std::front_insert_iterator` | ❌ no | `push_front` not defined | | `std::insert_iterator` | ❌ no | `insert` not defined | | `std::const_iterator` (C++23) | ❌ no | C++23 not supported yet | -| `std::move_iterator` | ✔️ yes | Limited usefulness since dereference returns `reference` not rvalue (`&&`) | -| `std::counted_iterator` | ✔️ yes | | +| `std::move_iterator` | ✔️ yes | Limited usefulness since dereference returns `reference` type not rvalue reference (`&&`) | +| `std::counted_iterator` | ✔️ yes | `operator->` not defined as it requires `std::contiguous_iterator` | ## Collection and standard algorithms diff --git a/tests/unittests/std_interoperability.cpp b/tests/unittests/std_interoperability.cpp index 2a72952ea..cd0a5e64c 100644 --- a/tests/unittests/std_interoperability.cpp +++ b/tests/unittests/std_interoperability.cpp @@ -1117,6 +1117,11 @@ TEST_CASE("Collection and std iterator adaptors", "[collection][container][adapt REQUIRE(counted != std::default_sentinel); REQUIRE(counted.count() == 1); REQUIRE((*counted).cellID() == 42); + DOCUMENTED_STATIC_FAILURE(std::contiguous_iterator); // counted-> requires std::contiguous_iterator + // REQUIRE(counted->cellID() == 42); + DOCUMENTED_STATIC_FAILURE(traits::has_member_of_pointer_v); // can't base()->() because + // base() returns const object + // REQUIRE(counted.base()->cellID() == 42); REQUIRE(++counted == std::default_sentinel); } // const_iterator @@ -1128,6 +1133,11 @@ TEST_CASE("Collection and std iterator adaptors", "[collection][container][adapt REQUIRE(counted != std::default_sentinel); REQUIRE(counted.count() == 1); REQUIRE((*counted).cellID() == 42); + DOCUMENTED_STATIC_FAILURE(std::contiguous_iterator); // counted-> requires std::contiguous_iterator + // REQUIRE(counted->cellID() == 42) + DOCUMENTED_STATIC_FAILURE(traits::has_member_of_pointer_v); // can't base()->() because + // base() returns const object + // REQUIRE(counted.base()->cellID() == 42); REQUIRE(++counted == std::default_sentinel); } }