if it was possible it would allow us to write, for example:
copy( make_filter_iterator
(numbers, numbers + N), numbers + N, ostream_iterator<int>(cout, " ")); rather than:
copy( make_filter_iterator
(numbers, numbers + N), make_filter_iterator (numbers + N, numbers + N), ostream_iterator<int>(cout, " ")); of course i am aware that i might be missing something obvious ...
I think you are. the signature of std::copy is:
template
OutputIterator copy( InputIterator first, InputIterator last, OutputIterator result); What will the compiler deduce InputIterator to be?
you are right of course - which is a shame. for my own use, however, i would happily rewrite the stl algorithms to allow for this usage. i often find i have issues with that area of the standard library in any case: why does binary_search not return an iterator to the item i'm searching for? why min_element, max_element when best_element, worst_element is less confusing? why no copy_if? etc. of course that could just be me :) ian whittley