Boost logo

Boost :

From: Thorsten Ottosen (thorsten.ottosen_at_[hidden])
Date: 2007-07-06 12:05:31


Lewis Hyatt skrev:
> Anyway, I guess this isn't
> such a big issue, because if copying a container is too expensive, you
> probably shouldn't be returning it from functions anyway...

On the contrary, copying can be essentially free because of the Return
Value Optimization (RVO).

Eric, maybe there should be an extra macro:

BOOST_RVALUE_FOREACH( const T& x, get_rvalue_container() )

which does not make the copy? At the call site, you usually know
which macro to apply.

-Thorsten


Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk