Basic dynamic array (list/vector) implementation
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 

726 B

DynArray: Basic dynamic array (list/vector) implementation

Why? Why not.

How to use?

#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?

Got make?

make run

No make?

g++ example.cpp -o example
./example

Windows?

g++ example.cpp -o example.exe
.\example.exe

Windows without g++?

I never compiled something using msvc from the terminal. I guess make a new Visual Studio project, copy-paste the files in there and have fun, idk.