template <typename T> class clacs { private: T ref1 , ref2; public: clacs(T ref1_=0, T ref2_=0):ref1(ref1_), ref2(ref2_){cout<<"생성자호출"<<endl; cout<<ref1<<" "<<ref2<<endl;}
T add(T a , T b); T sub(T a , T b); T mul(T a, T b); T div(T a, T b); }; template <typename T> T clacs<T>::add(T a, T b) { cout<<"add호출"<<endl; return a+b; } template <typename T> T clacs<T>::sub(T a, T b) { return a-b; } template <typename T> T clacs<T>::mul(T a, T b) { return a*b; } template <typename T> T clacs<T>::div(T a, T b) { return a/b; };