Error: ‘THashList& THashList::operator=(const THashList&)’ i

Hi - I’m trying to loop over a bunch of rootfiles containing histograms.

The histograms are stored in a THashList

I get this error in the macro attached -

THashList.h:43: error: ‘THashList& THashList::operator=(const THashList&)’ is private

  • everything is fine if I do the steps in the command line. Any thoughts?
    mope.cpp (1.06 KB)

THashList last; .... last = (THashList*)gDirectory->Get("allhists"); is wrong (and CINT is being to permissive. You meant to use:

THashList *last; last = (THashList*)gDirectory->Get("allhists");
Cheers,
Philippe.

Hi Philippe, thank you for taking a look at that.

I have already done what I wanted (in a less elegant way), but to understand better I tested your change; I now find the error:

g++ -c mope.cpp -I$ROOTSYS/include -pthread -m64 -I/…/include
mope.cpp:35: error: ‘allhists’ was not declared in this scope

I attach two input files if you would like to test.

Regards.
hists_0269ab.root (31 KB)
hists_0268ab.root (30.9 KB)

[quote]mope.cpp:35: error: ‘allhists’ was not declared in this scope[/quote]What’s on line 35? Is alllists used as a C++ variable when it should be used as a quoted string?

Philippe.

THashList last;
last = (THashList
)gDirectory->Get(“allhists”);

HI,

There is something I can not understand. If line 35 is either of those 2 lines, I don’t see anyway for g++ to complain about allhists being not declared.

Thanks,
Philippe.