Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

This it no different than what you would get if you implemented std::vector with macros or by hand, but for some reason people like to count it as code bloat.

Not if you implement it as a resizeable array of bytes, which is what a lot of the std::vector-ish structures I see being used in C are. There's just one set of functions which work with different element sizes, not a set of nearly-identical ones for each element size (and sometimes even multiple identical ones for elements of the same size but different type.) It's definitely bloat when the result is highly redundant and bigger than necessary.



Just as it is possible to implement a std::vector-like container using void* without templates, it is possible to do it with templates and partial specialization. It's a question of how much work the implementor put into things.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: