【发布时间】:2014-02-06 15:33:50
【问题描述】:
你能看出这个函数声明有什么问题吗?
template<typename... Containers>
std::tuple<typename Containers::value_type...>
foo(const Containers &...args);
当我尝试调用它时,像这样:
foo(std::list<int>(), std::vector<float>());
MSVC2013 说error C2027: use of undefined type 'std::tuple<Containers::value_type>。
我尝试使用“延迟返回”语法重写函数声明,但没有任何区别。
有什么方法可以实现这段代码想要做的事情吗?
【问题讨论】:
-
你忘了
#include <tuple>吗?
标签: c++ variadic dependent-name