Topic: Sequence concept (was STL map interface improvment )


Author: Michiel Salters<Michiel.Salters@cmg.nl>
Date: Wed, 6 Jun 2001 20:16:47 GMT
Raw View
In article <3B19BEA2.796B6CAD@yahoo.com>, Dietmar Kuehl says...

[ SNIP ]

> The other equally important aspect is that there is no question
> how sequences are passed around: They are passed around as iterator
> pairs, not as some container with a type
> unusable at the other end anyway...

Unfortunately, that's not true. Sometimes a sequence is passed as
a (std::) pair of iterators, sometimes as an iterator and an iterator.
Consider writing a function that returns a sequence, and passing that
sequence to an STL algorithm.

std::for_each ( get_sequence() ... ?

While I diagree with the notion that algorithms should operate on
containers, I  do agree with the notion that they should work on
sequence _objects_. Making the deliberate choice that a function
returns a single object leaves us with no other simple options.

Regards
Michiel Salters

--
Michiel Salters
Consultant Technical Software Engineering
CMG Trade, Transport & Industry
Michiel.Salters@cmg.nl

---
[ comp.std.c++ is moderated.  To submit articles, try just posting with ]
[ your news-reader.  If that fails, use mailto:std-c++@ncar.ucar.edu    ]
[              --- Please see the FAQ before posting. ---               ]
[ FAQ: http://www.research.att.com/~austern/csc/faq.html                ]