Is there anyway to make a 1D dynamic and continuous array using C++11?
I will take in the size of the array via stdin
and once it's created it won't need to be resized.
Right now I am using a 1D vector of enums, and my biggest performance issue is the vector [] operator.
If it can't be done in C++, I am open to ways of doing it with malloc
and C, just please note the best way to delete
it.
Edit: Didn't realize vectors were night and day with debug and release. I reran callgrind with -O3 and now the issue is ostream not vectors - thanks to everyone who made me second guess myself before I rewrote it all using arrays when not needed.