RE:a question on adding class template t

From: Masaharu Goto (MXJ02154@niftyserve.or.jp)
Date: Thu Dec 11 1997 - 12:08:00 MET


Brian, 

Concerned about embedding class template

You can embed instantiated template class and function as precompiled
library , however, template itself can not be embedded. 

    template<class T> class Vector {
      ...
    };

    Vector<int> a;

 If you use above header file for rootcint or makecint, class 'Vector<int>' 
and object 'a' are known to cint, but not 'template<class T> class Vector' 
itself.  Download cint source package and look into demo/makecint/Array
directory. There is an example. 

P.S.
I'm trying to process STL on CINT. Rev 5.13.37 can process simple STL
program like below.

    #include <vector.h>
    #include <iostream.h>
    main() {
      vector<int> a;
      cout << a.begin() << " " << a.end() << endl;
    }

But, it is still a long way to interpret practical STL programs.


Masaharu Goto


>Hi,
>       I am not sure this is the right place to send this message, but
>I couldn't find an address for sending questions. I have tried the
>example in http://root.cern.ch/root/CintGenerator.html and successfully
>made MyClass known to CINT (or root).. I don't know, however, how to make
>a class template known to CINT. I would appreciate very much any advice. 
>Thanks.
>
>Brian Yang



This archive was generated by hypermail 2b29 : Tue Jan 04 2000 - 00:26:22 MET