lion03 / thrust

Automatically exported from code.google.com/p/thrust
Apache License 2.0
0 stars 0 forks source link

reduce_by_key needs to work on ForwardIterator #285

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
currently claims to work on InputIterator, but it needs to require 
ForwardIterator, similar to unique

Original issue reported on code.google.com by jaredhoberock on 7 Dec 2010 at 6:04

GoogleCodeExporter commented 8 years ago
IIRC we decided that InputIterator was fine, since reduce_by_key is more like 
unique_copy [1] than unique [2].  Specifically, you can respect InputIterator 
semantics by storing the result of *first in a temporary variable.

[1] http://www.sgi.com/tech/stl/unique_copy.html
[2] http://www.sgi.com/tech/stl/unique.html

Original comment by wnbell on 18 Dec 2010 at 9:06