How to partial specialization that two template parameter are same type.
How to make this code using second function .
#include <utility>
#include <iostream>
template <typename A, typename B>
void Translate(A&& a,B* b){
// make some translate from a to b
// b->bvalue=a.av;
std::cout<<"normal function";
}
//if a and b are same type,
template <typename A>
void Translate(A&& a, A* b) {
*b = std::forward<A>(a);
std::cout<<"forward function";
}
int main(int argc, char** argv) {
int in=0,out=0;
Translate(in,&out);
return 0;
}
Expect out put "forward function".