
6 Feb
2008
6 Feb
'08
4:34 p.m.
Thorsten Ottosen wrote:
Ok, but let me make the question more specific: why would you ever pass a container by value to push_back()?
Of course you wouldn't, but the first argument to push_back() may not, in fact, be a container. It may be an expression template that evaluates to a container. I could consider making push_back() "smart" and check whether its first argument is an expression template, or a terminal, or what, and assume any type it doesn't know about is a container that should be stored by reference, but this makes me uncomfortable. Now push_back() is special, and special cases makes things harder to learn. -- Eric Niebler Boost Consulting www.boost-consulting.com