RE: Bad CINT dictionary for class with THashTable data member

From: Canal, Philippe (pcanal@fnal.gov)
Date: Fri Dec 17 1999 - 22:56:18 MET


Hi Nick,

The compilation error comes from the fact that TCollections (including THashTable)
can not be used any copy constructor.  

Also C++ and CINT, provide a default constructor when there is none declared.
In your case the default constructor provided by cint has to contain the line:

>    p=new Test(*(Test*)G__int(libp->para[0]));

I am not sure why but somehow your compiler decided not to provided any copy
constructor in this case (probably because it would be illegal any way) and thus 
see only a constructor with no parameter (the one you specify) thus the error message:

> cxx: Error: TestCint.cc, line 130: In this statement, "(*(Test ...)G__int(libp->
> para[0]))" supplies 1 argument, but 0 are expected.

The compiler KCC, for the same code fails and says:

         "TCollection::TCollection(const TCollection &)" is inaccessible
  class THashTable : public TCollection {
                            ^
          detected during:
            implicit generation of "THashTable::THashTable(const THashTable &)"
                      at line 130
            implicit generation of "Test::Test(const Test &)" at line 130

The solution is for you to provide a copy constructor for your class.
(actually even if you use a pointer to a THashTable you probably should 
provide this copy constructor to remove any ambiguity on which object should
delete the THashTable).

Philippe Canal



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