Boost logo

Boost :

From: Victor A. Wagner Jr. (vawjr_at_[hidden])
Date: 2004-05-23 20:18:03


I'm w/ Pavel on this one. After reading my first book on the STL
(Josuttis) I was struck that although "ranges" are used all over the place,
nobody apparently ever formalized the concept into an actual
type. std::pair<iter, iter> certainly seems like something we'd like to
have actualized.
I understand that it's syntactic sugar, but given some more sugar e.g.
(approximation only)

template<class container>
pair<typename container::iterator, typename container::iterator>
all_of(container const& who) {return make_pair(who.begin(), who.end());}

then you could write:
vector<blah> x;
.
.
.
sort(all_of(x)); // instead of sort(x.begin(), x.end());
and such
this presumes, of course, that we add the similar syntactic sugar overloads
to all of the algorithms

At Sunday 2004-05-23 07:41, you wrote:

>"Gennadiy Rozental" <gennadiy.rozental_at_[hidden]> wrote:
>
> > I added several algorithms that extent STL algorithms set....
> >
>I think they belonh tp boost::algorithm.
>
>Wouldn't it make sense to add overloads
>that use std::pair<iter, iter>?, e.g:
>
>template <class InputIter1, class InputIter2>
>inline std::pair<InputIter1, InputIter2>
>mismatch(
> const std::pair<InputIter1, InputIter1>& seq1,
> const std::pair<InputIter2, InputIter2>& seq2
> )
>
>/Pavel
>
>
>
>
>
>_______________________________________________
>Unsubscribe & other changes: http://lists.boost.org/mailman/listinfo.cgi/boost

Victor A. Wagner Jr. http://rudbek.com
The five most dangerous words in the English language:
               "There oughta be a law"


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