A question on when_all

Jan 12, 2015 at 12:11 PM
Please consider the following code
vector<task<vector<int>>> vTasks;

//vector<vector<int>> res = when_all(vTasks.begin(), vTasks.end()).get();   //  C2440
vector<int> res = when_all(vTasks.begin(), vTasks.end()).get();
From the documentation it would seem that it is the commented out line that should compile correctly, while in fact it's the following. What's the matter?
Jan 12, 2015 at 8:13 PM
Hi alexKhaustov,

Yes what you are seeing is correct, we treat tasks of vectors as a special case. Instead of when_all returning a task of a vector of vectors, we collapse down the vectors so that you just get one instead of nesting. The thought was for most scenarios this actually makes it easier to use.