相关疑难解决方法(0)

定义与变量a相同类型的变量b

是否可以声明var_b与另一个变量相同类型的变量var_a?

例如:

template <class T>
void foo(T t) {

   auto var_a = bar(t);
   //make var_b of the same type as var_a

}


F_1 bar(T_1 t) {

}

F_2 bar(T_2 t) {

}
Run Code Online (Sandbox Code Playgroud)

c++ templates traits c++11

24
推荐指数
4
解决办法
2939
查看次数

标签 统计

c++ ×1

c++11 ×1

templates ×1

traits ×1