Closed GoogleCodeExporter closed 8 years ago
What are the semantics of transform_if without stencil?
OutputIterator transform_if(InputIterator first, InputIterator last,
OutputIterator result,
UnaryFunction op,
Predicate pred)
is it
if(pred(*first)) *result = op(*first);
or
if(pred(op(*first)) *result = op(*first);
?
Original comment by jaredhoberock
on 30 Aug 2011 at 7:28
The first one. If a user wanted the second one they could embed op in the
predicate.
Original comment by wnbell
on 30 Aug 2011 at 7:32
Should we add binary transform_if without stencil? It would look like:
ForwardIterator transform_if(InputIterator1 first1, InputIterator1 last1,
InputIterator2 first2,
ForwardIterator result,
BinaryFunction op,
BinaryPredicate pred)
Original comment by jaredhoberock
on 30 Aug 2011 at 10:28
Seems like that would be ambiguous with unary transform_if with stencil:
ForwardIterator transform_if(InputIterator1 first, InputIterator1 last,
InputIterator2 stencil,
ForwardIterator result,
UnaryFunction op,
Predicate pred)
If people want the binary version, they can use zip_iterator.
Original comment by jaredhoberock
on 30 Aug 2011 at 10:31
This issue was closed by revision f44edf6b5ccd.
Original comment by jaredhoberock
on 31 Aug 2011 at 12:53
Original issue reported on code.google.com by
jaredhoberock
on 3 May 2011 at 12:55