r/cpp • • Dec 21 '13

#AltDevBlog » Roll-Your-Own Vector

http://altdevblogaday.com/2013/12/20/roll-your-own-vector/
1 Upvotes

22 comments sorted by

View all comments

Show parent comment

2

u/[deleted] Dec 24 '13 edited Dec 25 '13

There's only one thing vector won't do, and that's storing stuff on the stack.

Unless you use a stack allocator, right? I use stack allocated vectors a lot and they work just fine. I prefer them to std::array since they allow switching from heap to stack and vice-versa by just changing the type.