Merge pull request #6 from insideoutclub/develop

Make BinaryOperator version of transform() stop when end of either range is reached (refs #9812)
This commit is contained in:
Nathan Ridge
2014-04-28 12:51:07 -04:00

View File

@@ -58,9 +58,8 @@ namespace boost
OutputIterator out, OutputIterator out,
BinaryFunction fn) BinaryFunction fn)
{ {
for (; first1 != last1; ++first1, ++first2) for (; first1 != last1 && first2 != last2; ++first1, ++first2)
{ {
BOOST_ASSERT( first2 != last2 );
*out = fn(*first1, *first2); *out = fn(*first1, *first2);
++out; ++out;
} }