Boost logo

Boost :

From: Ed Brey (edbrey_at_[hidden])
Date: 2001-07-26 11:33:17


From: "Peter Dimov" <pdimov_at_[hidden]>

> > When will the reference ever need to be non-const? All the
underlying
> > algorithms take iterators by value, and hence leave them untouched.
>
> When you decide to add an overload:
>
> template<class R> void sort(R & r)
> {
> std::sort(r.begin(), r.end());
> }
>
> template<class T> void sort(std::list<T> & l)
> {
> l.sort();
> }

I don't follow. Why does the std::list<T>& overload prevent the other
function from being R const& ?


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