Boost logo

Boost :

From: Thorsten Ottosen (tottosen_at_[hidden])
Date: 2006-02-03 08:02:28


Neal Becker wrote:
> For what it's worth, the use case I most often employ is:
>
> template<typename out_t, typename in_t>
> out_t func (in_t const& in) {
> out = out_t (boost::size (in));
> do something
> return out;
> }
>
> I realize this isn't always efficient, but it's very convenient. Also, I
> hope my preferred compiler (gcc-4.1) will perform RVO.

This reminds me thar there is another reason for not supplying "output
ranges":

    out_t = boost::copy_range<out_t>( rng | xxx | yyy );

and this is optimal with RVO.

-Thorsten


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