I just got through reading some of Stroustup's C++ Style and Technique FAQ.
Bjarne says that a "big" object is "Anything larger than a couple of words." and that you should pass such by reference. Cool, I can dig that.
Later on in the FAQ, there's a discussion of why STL containers can be slow when dealing with "huge" objects, and that an easy fix is to make a container of pointers like so:
So what's "huge"? A few megabytes like in his example? Should I make all my vecotrs, lists, stacks, queues, etc. that have "big" objects as containers of pointers?Code:vector<myHugeObject*> foo;
What are your thoughts?