I am trying to unpack a tuple and use the results to assign into members. Is it possible to do that in idiomatic C++17?
I realize that std::tie
exists but I am trying to utilize C++17 features and not default to older features nor the old way (std::get<N>(tuple)
)
tuple<A, vector<A>> IO(){
//IO happens here
return {var, vec};
}
class foo{
public:
foo();
private:
A var;
vector<A> vec;
};
foo::foo(){
//this line here: I want to assign var and vec from IO()
[var, vec] = IO();
}