Std::complex and clone function

Dear ROOT’ers
I have problem with calling clone method for my class. My class looks like this

class SH: public OhterClassFromTObject{
const Int_t fMaxJM;
std::complex<double> *fYlmBuffer; // [fMaxJM] 
+ other members, arrays etc. +
SH(): fYlmBuffer(NULL),fMaxJM(0){

However when i try to call SH::Clone I get error “internal-error: print_frame_args: Assertion `nsym != NULL’ failed.”
When I replace

std::complex<double> *fYlmBuffer; // [fMaxJM] 

by this

std::complex<double> *fYlmBuffer; // !

Code works. So I suppose there is something wrong with my class structure. Can anyone help me what might be the reason? I suppose that in ROOT 6 std::complex is supported (I don’t have manually create dictionary for this class).

_ROOT Version: 6.10/08
Platform: Min 18
Compiler: g++ 5.4.0

I can not reproduce this problem with the master or 6.16. (you seem to be used a much older release 6.10).

However, note that for things to work correctly your class (since it derives from TObject) you will need to use ClassDef within your class. Also the combination of:

const Int_t fMaxJM;


SH(): fYlmBuffer(NULL),fMaxJM(0){

is odd (since it means that the array is always empty).

i.e. I recommend you try with a newer version of ROOT and if it fails to give a more complete example.


actually I removed this array from my code. But I would ask about this “const int” issue - is this variable overwritten when I load object from TFile? My main idea was - that I had two constructors - one where I specify fMaxJM!=0 and second (without arguments) that is used only for reading stuff from files.

is this variable overwritten when I load object from TFile?

Yes, it should …

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.