TDSet(const TDSet&) private

Why TDSet(const TDSet&) is private? This means that I can’t pass or return it by value!

The copy constructor and the assignment operator are not implemented for this class, as for many other classes in ROOT. The automatically generated versions do not make sense, so they are declared as private, to prevent their use.

Note that making copies of large TDSets maybe very expensive performance-wise.
Why can’t you work with pointers?

G. Ganis

[quote=“ganis”]The copy constructor and the assignment operator are not implemented for this class, as for many other classes in ROOT. The automatically generated versions do not make sense, so they are declared as private, to prevent their use.

Note that making copies of large TDSets maybe very expensive performance-wise.
Why can’t you work with pointers?

G. Ganis[/quote]

Yes, I can, but I don’t like it because they’re memory leak prone.

It is a trade-off between performance and resource usage.
Anyhow, you can pass TDset by reference. That works.

#include "TDSet.h"
void printDSet(TDSet &d)
{
   d.Print("a");
}

G. Ganis

[quote=“ganis”][quote]
Yes, I can, but I don’t like it because they’re memory leak prone.
[/quote]
It is a trade-off between performance and resource usage.
Anyhow, you can pass TDset by reference. That works.

#include "TDSet.h"
void printDSet(TDSet &d)
{
   d.Print("a");
}

G. Ganis[/quote]

my problem is the return value, by the way, don’t worry it’s not a big problem to return a pointer only one time