Skip to content

Commit 4c9339b

Browse files
committed
Tweaks in docs
1 parent 79fb9c3 commit 4c9339b

File tree

5 files changed

+16
-13
lines changed

5 files changed

+16
-13
lines changed

CMakeLists.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -82,6 +82,7 @@ add_subdirectory(src/beman/iterator_interface)
8282
add_subdirectory(include/beman/iterator_interface)
8383

8484
if(BEMAN_ITERATOR_INTERFACE_BUILD_TESTS)
85+
enable_testing()
8586
add_subdirectory(tests/beman/iterator_interface)
8687
endif()
8788

README.md

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ Documentation and associated papers are licensed with the Creative Commons Attri
1717

1818
// SPDX-License-Identifier: CC-BY-4.0
1919

20-
The intent is that the source and documentation are available for use by people implementing their iterator types as well as people using the iterator_interface presented here as-is.
20+
The intent is that the source and documentation are available for use by people implementing their iterator types.
2121

2222
The README itself is licesed with CC0 1.0 Universal. Copy the contents and incorporate in your own work as you see fit.
2323

@@ -164,15 +164,15 @@ Preset CMake variables:
164164
-- Found Threads: TRUE
165165
-- Configuring done (2.7s)
166166
-- Generating done (0.0s)
167-
-- Build files have been written to: /home/dariusn/git/Beman/iterator_interface/.build/gcc-debug
167+
-- Build files have been written to: /path/to/repo/.build/gcc-debug
168168

169169
Executing workflow step 2 of 3: build preset "gcc-debug"
170170

171171
[15/15] Linking CXX executable tests/beman/iterator_interface/beman.iterator_interface.tests
172172

173173
Executing workflow step 3 of 3: test preset "gcc-debug"
174174

175-
Test project /home/dariusn/git/Beman/iterator_interface/.build/gcc-debug
175+
Test project /path/to/repo/.build/gcc-debug
176176
Start 1: IteratorTest.TestGTest
177177
1/4 Test #1: IteratorTest.TestGTest ........... Passed 0.01 sec
178178
Start 2: IteratorTest.TestRepeatedChars
@@ -224,15 +224,15 @@ Preset CMake variables:
224224
-- Found Threads: TRUE
225225
-- Configuring done (2.7s)
226226
-- Generating done (0.0s)
227-
-- Build files have been written to: /home/dariusn/git/Beman/iterator_interface/.build/gcc-release
227+
-- Build files have been written to: /path/to/repo/.build/gcc-release
228228

229229
Executing workflow step 2 of 3: build preset "gcc-release"
230230

231231
[15/15] Linking CXX executable tests/beman/iterator_interface/beman.iterator_interface.tests
232232

233233
Executing workflow step 3 of 3: test preset "gcc-release"
234234

235-
Test project /home/dariusn/git/Beman/iterator_interface/.build/gcc-release
235+
Test project /path/to/repo/.build/gcc-release
236236
Start 1: IteratorTest.TestGTest
237237
1/4 Test #1: IteratorTest.TestGTest ........... Passed 0.00 sec
238238
Start 2: IteratorTest.TestRepeatedChars

examples/README.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -17,13 +17,13 @@ Check basic `beman.iterator_interface` library usages:
1717

1818
```shell
1919
# build
20-
$ cmake --workflow --preset gcc-14 # or choose one from --list-presets
20+
$ cmake --workflow --preset gcc-debug
2121

2222
# run repeated_chars_iterator.cpp
23-
$ .build/gcc-14/examples/Asan/beman.iterator_interface.examples.repeated_chars_iterator
23+
$ .build/gcc-debug/examples/beman.iterator_interface.examples.repeated_chars_iterator
2424
foofoof
2525

2626
# run filter_int_iterator.cpp
27-
$ .build/gcc-14/examples/Asan/beman.iterator_interface.examples.filter_int_iterator
27+
$ .build/gcc-debug/examples/beman.iterator_interface.examples.filter_int_iterator
2828
2 4 10 200
2929
```

examples/filter_int_iterator.cpp

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33

44
// [P2727](https://wg21.link/P2727) example:
55
// An iterator that allows filtering int elements of a sequence.
6+
67
#include <beman/iterator_interface/iterator_interface.hpp>
78

89
#include <algorithm>
@@ -25,7 +26,7 @@ struct filtered_int_iterator
2526
}
2627

2728
// A forward iterator based on iterator_interface usually requires
28-
// three user-defined operations. since we are adapting an existing
29+
// three user-defined operations. Since we are adapting an existing
2930
// iterator (an int *), we only need to define this one. The others are
3031
// implemented by iterator_interface, using the underlying int *.
3132
filtered_int_iterator& operator++() {
@@ -59,9 +60,9 @@ int main() {
5960
// skipping odd numbers. 0 is not skipped, so it will be the last element in the sequence.
6061
std::array a = {1, 2, 3, 4, 10, 11, 101, 200, 0};
6162
filtered_int_iterator it{std::begin(a), std::end(a), [](int i) { return i % 2 == 0; }};
62-
63-
while (*it) {
64-
std::cout << *it << " ";
63+
64+
while (*it) { // Expected output at STDOUT:
65+
std::cout << *it << " "; // 2 4 10 200 0
6566
++it;
6667
}
6768
std::cout << "\n";

examples/repeated_chars_iterator.cpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33

44
// [P2727](https://wg21.link/P2727) example:
55
// An iterator that allows iterating over repetitions of a sequence of characters.
6+
67
#include <beman/iterator_interface/iterator_interface.hpp>
78

89
#include <algorithm>
@@ -50,7 +51,7 @@ int main() {
5051
constexpr const std::string_view target = "foo";
5152
constexpr const auto len = 7; // Number of extracted characters from the sequence.
5253

53-
// Create iterators that iterate over the sequence "foofoofoofoofoofoo...".
54+
// Create iterators that go over the sequence "foofoofoofoofoofoo...".
5455
repeated_chars_iterator it_first(target.data(), target.size(), 0); // target.size() == 3 is the length of "foo", 0 is this iterator's position.
5556
repeated_chars_iterator it_last(target.data(), target.size(), len); // Same as above, but now the iterator's position is 7.
5657

0 commit comments

Comments
 (0)