Fraser Ross wrote:
Algorithms cannot be used with input stream iterators? Is copying the range
to a temporary container before using the algorithm the usual thing to do?
Input iterators are very limited beasts. Copying is one thing they
can do. You can also do for_each, find, count, count_if, mismatch,
equal, transform, merge, replace_copy, replace_copy_if, remove_copy,
remove_copy_if, unique_copy, partial_sort_copy, includes, set_union,
set_intersection, set_difference, set_symmetric_difference, accumulate,
inner_product, partial_sum, adjacent_difference, or
lexicographical_compare, using the input iterators (find a good book
that describes how these work).
So, I am not sure that copying is the _usual_ thing to do, it very much
depends on what algorithm you're looking at.
Victor