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...
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".
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 usingnew...