テンプレート関数の呼び出しテスト

naohiro19
記事: 256
登録日時: 14年前
住所: 愛知県

テンプレート関数の呼び出しテスト

投稿記事 by naohiro19 » 11年前

テンプレート関数の呼び出しテスト

CODE:

#include 

template 
void Show(T arg)
{
	using namespace std;
	cout << arg << endl;
}

int main()
{
	Show(1);
	Show(10.5);
	Show(15.5f);
	Show("aaa");
	Show('d');
	return 0;
}

アバター
usao
記事: 1889
登録日時: 12年前

Re: テンプレート関数の呼び出しテスト

投稿記事 by usao » 11年前

Show()を介さずに << だけでも既にテンプレートですけどね.