[C++]テンプレート関数のセミコロン

1256 ワード

#include <iostream>

using namespace std;
template <typename T>
void display(const T& element)
{
cout<<element<<endl;
};// ,

template <typename S>
void show(const S& element)
{
cout<<element<<endl;
}//
int main()
{
display<int>(1);
show<int>(2);
return 0;
}

作者:林が舞い上がる出典:http://www.cnblogs.com/zhengyuhong/本文の著作権は作者とブログ園に帰属して共有して、転載を歓迎して、しかし作者の同意を得ずに作者の情報を保留しなければならなくて、しかも文章のページの明らかな位置で原文の接続を提供します