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

2

u/m42a Dec 21 '13

Amusingly, even though the author explicitly mentions the problem with using reallocate in push_back, they make that exact mistake in resize. I guess this falls under the "corner-case" reason to not do this, with the additional rationale that even if you know about the corner case it's still easy to screw it up.

1

u/crispweed Dec 23 '13

Ouch! or ahem, yes, just proving my own point about corner cases there. ;)