Skip to content

Commit e85b10a

Browse files
committed
Fixed formatting.
1 parent b0bc2b0 commit e85b10a

2 files changed

Lines changed: 53 additions & 22 deletions

File tree

README.md

Lines changed: 51 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -18,24 +18,32 @@ Source is licensed with the Apache 2.0 license with LLVM exceptions
1818

1919
// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
2020

21-
Documentation and associated papers are licensed with the Creative Commons Attribution 4.0 International license.
21+
Documentation and associated papers are licensed with the Creative Commons
22+
Attribution 4.0 International license.
2223

2324
// SPDX-License-Identifier: CC-BY-4.0
2425

25-
The intent is that the source and documentation are available for use by people implementing their iterator types.
26+
The intent is that the source and documentation are available for use by people
27+
implementing their iterator types.
2628

27-
The README itself is licensed with CC0 1.0 Universal. Copy the contents and incorporate in your own work as you see fit.
29+
The README itself is licensed with CC0 1.0 Universal. Copy the contents and
30+
incorporate in your own work as you see fit.
2831

2932
// SPDX-License-Identifier: CC0-1.0
3033

3134
## Examples
3235

33-
Full runnable examples can be found in `examples/` - please check [examples/README.md](./examples/README.md) for building the code on local setup or on Compiler Explorer.
36+
Full runnable examples can be found in `examples/` - please check
37+
[examples/README.md](./examples/README.md) for building the code on local setup
38+
or on Compiler Explorer.
3439

3540
### Repeated Chars Iterator
3641

37-
The next code snippet shows iterator interface support added in [`std::iterator_interface` (P2727R)](https://wg21.link/P2727R4): define a random access iterator that iterates over a sequence of characters repeated indefinitely.
42+
The next code snippet shows iterator interface support added in
43+
[`std::iterator_interface` (P2727R)](https://wg21.link/P2727R4): define a random
44+
access iterator that iterates over a sequence of characters repeated indefinitely.
3845

46+
<!-- markdownlint-disable -->
3947
```cpp
4048
#include <beman/iterator_interface/iterator_interface.hpp>
4149

@@ -73,8 +81,9 @@ private:
7381
difference_type m_pos;
7482
};
7583

76-
// Create a repeated_chars_iterator that iterates over the sequence "foo" repeated indefinitely:
77-
// "foofoofoofoofoofoo...". Will actually extract a prefix of the sequence and insert it into a std::string.
84+
// Create a repeated_chars_iterator that iterates over the sequence "foo" repeated
85+
// indefinitely: "foofoofoofoofoofoo...". Will actually extract a prefix of the
86+
// sequence and insert it into a std::string.
7887
constexpr const std::string_view target = "foo";
7988
constexpr const auto len = 7; // Number of extracted characters from the sequence.
8089

@@ -87,16 +96,22 @@ std::copy(it_first, it_last, std::back_inserter(extracted_result));
8796
assert(extracted_result.size() == len);
8897
std::cout << extracted_result << "\n"; // Expected output at STDOUT: "foofoof"
8998
```
99+
<!-- markdownlint-enable -->
90100
91101
### Filter Integer Iterator
92102
93-
The next code snippet shows iterator interface support added in [`std::iterator_interface` (P2727R4)](https://wg21.link/P2727R4): define a forward iterator that iterates over a sequence of integers, skipping those that do not satisfy a predicate.
103+
The next code snippet shows iterator interface support added in
104+
[`std::iterator_interface` (P2727R4)](https://wg21.link/P2727R4): define a
105+
forward iterator that iterates over a sequence of integers, skipping those that
106+
do not satisfy a predicate.
94107
108+
<!-- markdownlint-disable -->
95109
```cpp
96110
#include <beman/iterator_interface/iterator_interface.hpp>
97111
98112
// filtered_int_iterator uses iterator_interface to define a forward iterator
99-
// that iterates over a sequence of integers, skipping those that do not satisfy a predicate.
113+
// that iterates over a sequence of integers, skipping those that do not satisfy
114+
// a predicate.
100115
template <typename Pred>
101116
struct filtered_int_iterator
102117
: beman::iterator_interface::ext_iterator_interface_compat<filtered_int_iterator<Pred>,
@@ -105,8 +120,9 @@ struct filtered_int_iterator
105120
// ...
106121
};
107122
108-
// Create a filtered_int_iterator that iterates over the sequence {1, 2, 3, 4, 10, 11, 101, 200, 0},
109-
// skipping odd numbers. 0 is not skipped, so it will be the last element in the sequence.
123+
// Create a filtered_int_iterator that iterates over the sequence {1, 2, 3, 4,
124+
// 10, 11, 101, 200, 0}, skipping odd numbers. 0 is not skipped, so it will be
125+
// the last element in the sequence.
110126
std::array a = {1, 2, 3, 4, 10, 11, 101, 200, 0};
111127
filtered_int_iterator it{std::begin(a), std::end(a), [](int i) { return i % 2 == 0; }};
112128
@@ -116,19 +132,21 @@ while (*it) {
116132
}
117133
std::cout << "\n";
118134
```
135+
<!-- markdownlint-enable -->
119136

120137
## How to Build
121138

122139
### Compiler Support
123140

124-
This is a modern C++ project which can be compiled with the latest C++ standards (**C++20 or later**).
141+
This is a modern C++ project which can be compiled with the latest C++ standards
142+
(**C++20 or later**).
125143

126144
Default build: `C++23`. Please check `etc/${compiler}-flags.cmake`.
127145

128146
### Dependencies
129147

130-
This project is mainly tested on `Ubuntu 22.04` and `Ubuntu 24.04`, but it should be as portable as CMake is. This
131-
project has no C or C++ dependencies.
148+
This project is mainly tested on `Ubuntu 22.04` and `Ubuntu 24.04`, but it
149+
should be as portable as CMake is. This project has no C or C++ dependencies.
132150

133151
Build-time dependencies:
134152

@@ -152,9 +170,11 @@ apt-get install \
152170

153171
#### Preset CMake Workflows
154172

155-
This project strives to be as normal and simple a CMake project as possible. This build workflow in particular will
156-
work, producing a static `beman.iterator_interface` library, ready to package:
173+
This project strives to be as normal and simple a CMake project as possible. This
174+
build workflow in particular will work, producing a static
175+
`beman.iterator_interface` library, ready to package:
157176

177+
<!-- markdownlint-disable -->
158178
```shell
159179
$ cmake --workflow --preset gcc-debug
160180
$ cmake --workflow --preset gcc-release
@@ -183,10 +203,12 @@ $ tree /opt/beman.iterator_interface
183203

184204
<details>
185205
<summary> Build beman.iterator_interface (verbose logs - gcc-debug) </summary>
206+
<!-- markdownlint-enable -->
186207

208+
This should build and run the tests with system GCC with the address and
209+
undefined behavior sanitizers enabled.
187210

188-
This should build and run the tests with system GCC with the address and undefined behavior sanitizers enabled.
189-
211+
<!-- markdownlint-disable -->
190212
```shell
191213
$ cmake --workflow --preset gcc-debug
192214
Executing workflow step 1 of 3: configure preset "gcc-debug"
@@ -239,10 +261,11 @@ Test project /path/to/repo/.build/gcc-debug
239261

240262
Total Test time (real) = 0.04 sec
241263
```
264+
<!-- markdownlint-enable -->
242265

243266
</details>
244267

245-
268+
<!-- markdownlint-disable -->
246269
<details>
247270
<summary> Install beman.iterator_interface (verbose logs - gcc-release) </summary>
248271

@@ -332,8 +355,8 @@ $ tree /opt/beman.iterator_interface
332355
└── libbeman.iterator_interface.a
333356

334357
8 directories, 9 files
335-
336358
```
359+
<!-- markdownlint-enable -->
337360

338361
</details>
339362

@@ -342,6 +365,7 @@ $ tree /opt/beman.iterator_interface
342365
##### Default Build
343366

344367
CI current build and test flows:
368+
345369
```shell
346370
# Configure.
347371
$ cmake -G "Ninja Multi-Config" \
@@ -391,8 +415,10 @@ $ tree /opt/beman.iterator_interface
391415
8 directories, 9 files
392416
```
393417

418+
<!-- markdownlint-disable -->
394419
<details>
395420
<summary> Build beman.iterator_interface and tests (verbose logs) </summary>
421+
<!-- markdownlint-enable -->
396422

397423
```shell
398424
# Configure build: default build production code + tests (BEMAN_ITERATOR_INTERFACE_BUILD_TESTING=ON).
@@ -418,11 +444,13 @@ Test project /path/to/repo/.build
418444

419445
Total Test time (real) = 0.67 sec
420446
```
447+
421448
</details>
422449

423450
##### Skip Tests
424451

425-
By default, we build and run tests. You can provide `-DBEMAN_ITERATOR_INTERFACE_BUILD_TESTING=OFF` and completely disable building tests:
452+
By default, we build and run tests. You can provide
453+
`-DBEMAN_ITERATOR_INTERFACE_BUILD_TESTING=OFF` and completely disable building tests:
426454

427455
```shell
428456
# Configure.
@@ -435,7 +463,8 @@ $ cmake -G "Ninja Multi-Config" \
435463

436464
##### Skip Examples
437465

438-
By default, we build and run tests. You can provide `-DBEMAN_ITERATOR_INTERFACE_BUILD_EXAMPLES=OFF` and completely disable building tests:
466+
By default, we build and run tests. You can provide
467+
`-DBEMAN_ITERATOR_INTERFACE_BUILD_EXAMPLES=OFF` and completely disable building tests:
439468

440469
```shell
441470
# Configure.

examples/README.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,10 @@ List of usage examples for `beman.iterator_interface`.
1010

1111
Check basic `beman.iterator_interface` library usages:
1212

13+
<!-- markdownlint-disable -->
1314
* [P2727](https://wg21.link/P2727): local [./repeated_chars_iterator.cpp](./repeated_chars_iterator.cpp) or [repeated_chars_iterator.cpp@Compiler Explorer](https://godbolt.org/z/Yn9K15c9b)
1415
* [P2727](https://wg21.link/P2727): local [./filter_int_iterator.cpp](./filter_int_iterator.cpp) or [filter_int_iterator.cpp@Compiler Explorer](https://godbolt.org/z/q6933enqe)
16+
<!-- markdownlint-enable -->
1517

1618
## Local Build and Run
1719

0 commit comments

Comments
 (0)