Skip to content

Commit 2af7ea5

Browse files
committed
fix format
1 parent f1f0aeb commit 2af7ea5

4 files changed

Lines changed: 5 additions & 6 deletions

File tree

doc/collections_as_container.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -93,8 +93,8 @@ In the following tables a convention from `Collection` is used: `iterator` stand
9393
| `std::random_access_iterator` | ✔️ yes | ✔️ yes |
9494
| `std::contiguous_iterator` | ❌ no | ❌ no |
9595

96-
> [!NOTE]
97-
>The collections' iterators fulfil the `std::forward_iterator` except that the pointers obtained with `->` remain valid only as long as the iterator is valid instead of as long as the range remain valid. In practice this means a `ptr` obtained with `auto* ptr = it.operator->();` is valid only as long as `it` is valid.
96+
> [!NOTE]
97+
>The collections' iterators fulfil the `std::forward_iterator` except that the pointers obtained with `->` remain valid only as long as the iterator is valid instead of as long as the range remain valid. In practice this means a `ptr` obtained with `auto* ptr = it.operator->();` is valid only as long as `it` is valid.
9898
>The values obtained immediately through `->` (for instance `auto& e = it->energy();`) behaves as expected for `std::forward_iterator` as their validity is tied to the validity of a collection.
9999
100100
### LegacyIterator

python/templates/Collection.h.jinja2

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -187,7 +187,7 @@ public:
187187
}
188188
const_reverse_iterator crend() const {
189189
return rend();
190-
}
190+
}
191191

192192

193193
{% for member in Members %}

tests/unittests/std_interoperability.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -743,10 +743,10 @@ TEST_CASE("Collection and unsupported iterator concepts", "[collection][containe
743743
DOCUMENTED_STATIC_FAILURE(std::output_iterator<const_iterator, CollectionType::mutable_type>);
744744
// std::contiguous_iterator
745745
DOCUMENTED_STATIC_FAILURE(std::is_lvalue_reference_v<iterator::reference>);
746-
DOCUMENTED_STATIC_FAILURE(std::same_as<iterator::value_type, std::remove_cvref_t<iterator::reference>>);
746+
DOCUMENTED_STATIC_FAILURE(std::same_as<iterator::value_type, std::remove_cvref_t<iterator::reference>>);
747747
DOCUMENTED_STATIC_FAILURE(std::contiguous_iterator<iterator>);
748748
DOCUMENTED_STATIC_FAILURE(std::is_lvalue_reference_v<const_iterator::reference>);
749-
STATIC_REQUIRE(std::same_as<const_iterator::value_type, std::remove_cvref_t<const_iterator::reference>>);
749+
STATIC_REQUIRE(std::same_as<const_iterator::value_type, std::remove_cvref_t<const_iterator::reference>>);
750750
DOCUMENTED_STATIC_FAILURE(std::contiguous_iterator<const_iterator>);
751751
}
752752
#endif // __cplusplus >= 202002L

tests/unittests/unittest.cpp

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -220,7 +220,6 @@ TEST_CASE("Reverse iterators", "[basics]") {
220220
REQUIRE((*++it).energy() == 42);
221221
}
222222

223-
224223
TEST_CASE("Notebook", "[basics]") {
225224
auto hits = ExampleHitCollection();
226225
for (unsigned i = 0; i < 12; ++i) {

0 commit comments

Comments
 (0)