IDE:code::block
1
---
#ifndef TYPET_HPP
#define TYPET_HPP
template<class T> class A{
public:
T g(T a,T b);
// A();
};
#endif // TYPET_HPP
----------
#include <iostream>
#include"typet.hpp"
//template<class T> A<T>::A(){}
template<class T> T A<T>::g(T a,T b){
return a+b;
}
int main(){
A<int> a;
std::cout<<a.g(2,3.2)<<std::endl;
}
---------------