Here's another FAQ about modern C++11 style, and how C++11 is simpler than classic C++, including that this affects how we design our interfaces to make them simpler and easier to read and use.
However, be sure to read through the comments, because they cover several considerations including when it's safe to start relying on the simpler C++11 semantics as you migrate a code base from C++98 to C++11 and may still have to support C++98 clients for a while.
In C++, is it still bad practice to return a vector from a function?
Short version: It's common to return large objects—such as vectors/arrays—in many programming languages. Is this style now acceptable in C++0x if the class has a move constructor, or do C++ programmers consider it weird/ugly/abomination?
Long version: In C++0x is this still considered bad form?
std::vector<std::string> BuildLargeVector(); ... std::vector<std::string> v = BuildLargeVector();
[...]
Add a Comment
Comments are closed.