C++从入门到精通——模板

#include 
#include 
using namespace std;

template 
T const& Max(T const& a,T const& b){

    return a>b?a:b;

}
int main(){
    int x,y;
    float x1,y1;
    string x2,y2;
    x = 1;
    y = 2;
    x1 = 1;
    y1 = 2;
    x2 = "hello";
    y2 = "world";

    cout<

C++从入门到精通——模板_第1张图片

你可能感兴趣的:(C++,c++)