Am 29.09.2012 16:02, schrieb ArbolOne: > Sorry, I know that this is not a gtkmm code, but I need to plug a > template similar to this one in my gtkmm program, and for some reason it > will not compile. I just might be that I tired, but I cannot see > anything wrong in this code. > template <class T> class Data{ > private: > T data; > public: > Data(); > Data(T); > virtual ~Data(); > }; > template <class T> > jme::Data<T>::Data() {} > > template <class T> > jme::Data<T>::Data(T _data) { > this->data = _data; > } > template <class T> > jme::Data<T>::~Data() {} > ............. > using namespace std; > int main() { > jme::Data<int> d(1); // this does not work > jme::Data<int> d; // this does not work > cout << "Hello world!" << endl; > return 0; > } Works for me. Can you provide the error message?
Attachment:
signature.asc
Description: OpenPGP digital signature