From c8bc3f270a09245b8d22d66fa9f26deca3693c87 Mon Sep 17 00:00:00 2001 From: Dan Cojocaru Date: Sun, 21 Nov 2021 00:55:18 +0200 Subject: [PATCH] Expanded code example --- README.md | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/README.md b/README.md index e2a7b1c..b544236 100644 --- a/README.md +++ b/README.md @@ -6,6 +6,19 @@ Why? Why not. ```cpp #include "dynarray.hpp" + +// And then later in code + +DynArray 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?