Dear rooters, I nedd to define a class (TChannel) containing a TOptional object which is a template class, but when I compile the source I obtain the follow messages: > In file included from TExample.cxx:16: > TExample.h:23: `T' was not declared in this scope > TExample.h:23: template argument 1 is invalid > TExample.h:23: ISO C++ forbids declaration of `opt' with no type Can you help me? Thanks in advance, Silvia. /----- Appendix ------------------------------ / my header file: TExample.h #ifndef ROOT_TExample #define ROOT_TExample #include <TObject.h> template <class T> class TOptional : public TObject { private: UInt_t lenght; T value; public: TOptional(); ClassDefT(TOptional,1); }; ClassDefT2(TOptional,T) ClassImpT(TOptional,T) class TChannel : public TObject { private: char ch_name[20]; TOptional<T> *opt; public: TChannel(); ClassDef(TChannel,1) }; #endif My source: TExample.cxx #include "TExample.h" TChannel(); /---------------------------------------------/ My compile command: g++ -O -Wall -fPIC -D_REENTRANT -I/afs/fusione.it/project/fturoot/ROOT/include/root -c TExample.cxx -- Silvia Eccher (Iannone) <silvia.eccher@frascati.enea.it>
This archive was generated by hypermail 2b29 : Sat Jan 04 2003 - 23:51:23 MET