This project is read-only.


defined in header <pplpp.h>
template<typename Func>
unwrapperedFunctor<Func> unwrap_tuple(const Func& f)


Creates a functor that unwraps the return tuple of the input functor. We can use this function to pass data in task continuations.


  • func: A functor which returns a tuple of tasks or Async operations.

Return values

A functor which returns a task, and the task returns the unwrapped tuple.
If the input functor returns std::tuple<task<T>, IAsyncOperation<StorageFile>^>, the return value of this function is a functor which returns std::tuple<T, StorageFile^>.


The return tuple of input functor cannot include task<void>


auto folder = KnownFolders::PicturesLibrary;
auto getFileTask = concurrency::create_task(pplpp::unwrap_tuple([this, folder]{
auto task1 = concurrency::create_task([]{return 1; });
auto tuple = std::make_tuple(task1, folder->GetFileAsync("sample.txt"));
              return tuple;

getFileTask.then([this](std::tuple<int, StorageFile^ > tuple){
               auto v1 = std::get<0>(tuple);
               auto v2 = std::get<1>(tuple);

Last edited Jul 8, 2013 at 10:43 PM by gbb21, version 3


No comments yet.