📜  在 C++ 代码示例中使用函数模板进行交换

📅  最后修改于: 2022-03-11 14:44:45.567000             🧑  作者: Mango

代码示例1
#include 
using namespace std;
template
void excha(T &a , T1 &b){
    T temp = a;
    a = b;
    b = temp;
    
}
int main(){
    // int a , b;
    // cout<<"Enter the value of a and B "<>a>>b;
    // excha(a,b);
    // cout<>a>>b;
    // excha(a,b);
    // cout<>a;
    cin>>b;
    excha(a,b);
    cout<