Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我想知道是否可以编写一个类似std::tie()- 的函数(使用模板编程),它只能绑定元组的选择组件,并将其他组件绑定到一些占位符,例如std::bind(). 如果是这样,只需要为他/她感兴趣的部分声明变量。
std::tie()
std::bind()
例如,
std::tie(x,_1,y,_2) = (2,3,4,5);
你在找std::ignore吗?
std::ignore
IE:
std::tie(x,std::ignore,y,std::ignore) = std::make_tuple(2,3,4,5);