Boost logo

Boost :

From: David Abrahams (david.abrahams_at_[hidden])
Date: 2002-01-31 18:00:59


----- Original Message -----
From: "witt_ive" <witt_at_[hidden]>

>
> The default_iterator_policies member often take the iterator_adaptor
> argument by const reference. Doesn't this introduce uneccessary
> tempories?
>
> As in:
>
> template <class IteratorAdaptor>
> typename IteratorAdaptor::reference dereference(const
> IteratorAdaptor& x) const
> { return *x.base(); }
>
> Would mean get a copy of base (base() const is used) and dereference
> that.

????
The defintion of base()const is:

    base_type const& base() const { return m_iter_p.first(); }

Where's the copy? Am I missing something here?


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