是否可以声明var_b与另一个变量相同类型的变量var_a?
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) { }
c++ templates traits c++11
c++ ×1
c++11 ×1
templates ×1
traits ×1