Expanded code example

This commit is contained in:
Kenneth Bruen 2021-11-21 00:55:18 +02:00
parent c59cb5ac2a
commit c8bc3f270a
Signed by: kbruen
GPG key ID: C1980A470C3EE5B1

View file

@ -6,6 +6,19 @@ Why? Why not.
```cpp
#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?