can we do deep tie with a c++1y std::tie() -like function?
问题 Is there a way to write a variant of std::tie in c++11/1y that ties deeply into a tuple. That is, one in which tie((x,y),z) = make_tuple(make_tuple(1,2),3) binds x, y, z to 1, 2 and 3 , respectively as in the following example. It would be nice. Thanks. #include <tuple> #include <iostream> using namespace std; int main() { int x, y ,z; auto t = make_tuple(1,2); std::tie(y,x)= t; //std::tie((x,y),z) = make_tuple(t,3); //not working cout << x << y << z << endl; return 0; } 回答1: Maybe you're