when_all Function

Information
The topic you requested is included in another documentation set. For convenience, it's displayed below. Choose Switch to see the topic in its original location.
This topic has not yet been rated - Rate this topic
Visual Studio 2012

Creates a task that will complete successfully when all of the tasks supplied as arguments complete successfully.

template <
   typename _Iterator
>
auto when_all(
   _Iterator_Begin,
   _Iterator_End
) -> decltype (details::_WhenAllImpl<std::iterator_traits<_Iterator>::value_type::result_type, _Iterator>::_Perform(nullptr, _Begin, _End));

template <
   typename _Iterator
>
auto when_all(
   _Iterator_Begin,
   _Iterator_End,
   cancellation_token _CancellationToken
) -> decltype (details::_WhenAllImpl<std::iterator_traits<_Iterator>::value_type::result_type, _Iterator>::_Perform(_CancellationToken._GetImplValue(), _Begin, _End));
_Iterator

The type of the input iterator.

_Begin

The position of the first element in the range of elements to be combined into the resulting task.

_End

The position of the first element beyond the range of elements to be combined into the resulting task.

_CancellationToken

The cancellation token which controls cancellation of the returned task. If you do not provide a cancellation token, the resulting task will be created with a token that is a combination of all the cancelable tokens (tokens created by methods other than cancellation_token::none()of the tasks supplied.

A task that completes sucessfully when all of the input tasks have completed successfully. If the input tasks are of type T, the output of this function will be a task<std::vector<T>>. If the input tasks are of type void the output task will also be a task<void>.

If one of the tasks is canceled or throws an exception, the returned task will complete early, in the canceled state, and the exception, if one is encoutered, will be thrown if you call get() or wait() on that task.

Header: ppltasks.h

Namespace: concurrency

Did you find this helpful?
(1500 characters remaining)
© 2013 Microsoft. All rights reserved.