Expanded code example
This commit is contained in:
parent
c59cb5ac2a
commit
c8bc3f270a
1 changed files with 13 additions and 0 deletions
13
README.md
13
README.md
|
@ -6,6 +6,19 @@ Why? Why not.
|
||||||
|
|
||||||
```cpp
|
```cpp
|
||||||
#include "dynarray.hpp"
|
#include "dynarray.hpp"
|
||||||
|
|
||||||
|
// And then later in code
|
||||||
|
|
||||||
|
DynArray<int> arr;
|
||||||
|
arr << 5;
|
||||||
|
// Classic for:
|
||||||
|
for (int i = 0; i < arr.size(); i++) {
|
||||||
|
// Do stuff with arr[i]
|
||||||
|
}
|
||||||
|
// Range based for:
|
||||||
|
for (auto elem : arr) {
|
||||||
|
// Do stuff with elem
|
||||||
|
}
|
||||||
```
|
```
|
||||||
|
|
||||||
## How to run example?
|
## How to run example?
|
||||||
|
|
Loading…
Add table
Reference in a new issue