【发布时间】:2020-04-23 10:09:12
【问题描述】:
我正在为样板代码使用 lambda 函数:
auto import = [&](auto & value){
// Do some stuff
};
由于value 实际上是一个std::vector,我需要访问它的value_type 静态成员以在其元素之一上调用模板函数。
我尝试使用 decltype 没有成功:
auto import = [&](auto & value){
decltype(value)::value_type v;
};
有什么办法吗?
【问题讨论】:
-
use of 'auto' in lambda parameter declaration only available with c++14...请更新您的问题标签
标签: c++ templates c++14 auto decltype