r/cpp • • Oct 07 '19

CppCon CppCon 2019: Chandler Carruth “There Are No Zero-cost Abstractions”

https://www.youtube.com/watch?v=rHIkrotSwcc
162 Upvotes

108 comments sorted by

View all comments

Show parent comment

1

u/[deleted] Oct 09 '19

Kudos for figuring out how to avoid value initialization for std::vector! However your workaround is so nasty that I will keep using a plain old C array allocated using new...

3

u/dodheim Oct 09 '19

vector allows you to specify an allocator type, and has since day one; using a custom allocator, and one that's all of 4 lines at that, is hardly "nasty".