Template ctor's and CINT's type system

In ROOT 5.17/08, I do the following:

root [12] TClass *c = gROOT->GetClass("TUnuranEmpDist") root [13] TList *l = c->GetListOfMethods() root [14] TMethod *m = (TMethod*)l->At(25) root [15] m->GetPrototype() (const char* 0xd00160)"TUnuranEmpDist TUnuranEmpDist::TUnuranEmpDist(double* begin,double* end,unsigned int dim=1)"

I get back the ctor for TUnuranEmpDist as above. But when I look at the .h header that comes with the 5.17/08 distribution I see the ctor is actually defined differently by CINT:

template<class Iterator> TUnuranEmpDist (Iterator begin, Iterator end, unsigned int dim = 1) : fData(std::vector<double>(begin,end) ), fDim(dim), fMin(0), fMax(0), fBinned(0) {}

I assume the difference is because CINT can’t deal with a template member function (or ctor). Is there any way for me to tell that this ctor is a template member function? I’d like to avoid it when I generate real C++ code based on the CINT meta-data.


Hi Gordon,

the templated constructor is not available in CINT, only template instances of it (only those have machine code that can be executed). What you see is most probably the instance with vector::iterator as template argument. Unuran’s LinkDef.h decides which template instances a CINT dictionary entry is created.

CINT typedefs vector::iterator to T*. That’s of course wrong; we will fix that after the production release in the new (i.e. currently non-production) CINT.

Cheers, Axel.