2
0
mirror of https://github.com/boostorg/mpi.git synced 2026-02-25 04:22:17 +00:00

Test_any loop was only testing the first request.

test_any was actually only testing the first request due to a typo in the for loop.
(cherry picked from commit 6c597245a2)
This commit is contained in:
Alain Miniussi
2014-09-10 11:03:11 +02:00
parent bc13577187
commit f4b1d96a55

View File

@@ -138,10 +138,12 @@ template<typename ForwardIterator>
optional<std::pair<status, ForwardIterator> >
test_any(ForwardIterator first, ForwardIterator last)
{
for (ForwardIterator current = first; first != last; ++first) {
while (first != last) {
// Check if we have found a completed request. If so, return it.
if (optional<status> result = current->test())
return std::make_pair(*result, current);
if (optional<status> result = first->test()) {
return std::make_pair(*result, first);
}
++first;
}
// We found nothing