Opinions on standard library <memory> use

Started by
10 comments, last by cardinal 10 years, 6 months ago

That depends on what you mean by basic array. The cost of std::vector vs. an array dynamically allocated with new [] is negligible under most circumstances. However, if you have a fixed sized array that doesn't need dynamic allocation then you're better off with std::array than std::vector.

Advertisement

Paul Pedriana's paper on EASTL explains the reasoning why STL was avoided rather than used in the games industry (at least in some companies). It's a bit old (2003), so it's in response to dealing with PS1/PS2 eras of hardware. Some of the issues aren't as big of a deal on modern hardware.

http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2007/n2271.html

To my knowledge there haven't been any follow ups to this paper, and I don't really follow how the C++ standard has changed over the years (I'm a bad boy), so I don't know what, if anything, has changed in the standard library since 2003 off the top of my head.

This topic is closed to new replies.

Advertisement