Is it possible (using type traits) to declare a variable var_b of the same type as another variable, var_a has?
For example:
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) {
}
Aucun commentaire:
Enregistrer un commentaire