// test.cpptemplate<typenameT>voidTest<T>::foo(){cout<<"foo"<<endl;}template<typenameT>voidTest<T>::bar(){cout<<"bar"<<endl;}//template class Test<int>; // foo, bar 모두 인스턴스화//template void Test<int>::foo();templatevoidTest<int>::bar();template<typenameT>Tsquare(Ta){returna*a;}//template int square<int>(int); // 정석//template int square<>(int);templateintsquare(int);