TTask assignment operator

Dear Rooters
I’m developing a set of classes that inherits from TTask.
I was writing the assignment operator for these classes and of course I have to call the assignment operator of the base class and I noticed this note about the assignment operator of TTask:

root.cern.ch/root/html/TTask.html

I gave a quick look at the source code for the assignment operator and the only thing I noticed are these calls:

[quote] fOption=tt.fOption;
fBreakin=tt.fBreakin;
fBreakout=tt.fBreakout;
fHasExecuted=tt.fHasExecuted;
fActive=tt.fActive;
[/quote]
All these object are protected and shouldn’t be accessible. How is it even possible for ROOT to compile with such a call sequence. I derived many classes from TTask because I like to reuse the execution flow that TTask defines and I never had any complaint by the compiler and I didn’t had any problem during execution, even if I doubt I ever used the assignment of a TTask to another TTask.
If the assignment operator is wrong, as it’s said in the documentation shouldn’t it be better set private so that you don’t incur in the risk of using the operator without noticing this footnote?
Even worse is that the copy constructor, which is defined more or less by the same function calls is not marked in any way as wrong and this confuses me quite a bit.

Is there some reason due to the logic of the TTask class why it should not be assigned, but could be copy constructed? Is there some reason to keep a “wrong” method to be inadvertently called by the user?

if you’re using “rootcint dictionary” for your classes (created via an explicit call to “rootcint” or via “ACLiC”), then … the dictionary source code will contain: #if !defined(R__ACCESS_IN_SYMBOL) //Break the privacy of classes -- Disabled for the moment #define private public #define protected public #endif See, for example, two recent threads: http://root.cern.ch/root/roottalk/roottalk12/0234.html and http://root.cern.ch/root/roottalk/roottalk12/0092.html

OMG :open_mouth:
I forgot about those lines and I forgot why those are there in the first place, they defy everything I ever known of O-O programming, but maybe I prefer not to know :slight_smile:
Indeed I’m using the dictionary for my ROOT related class to be able to write my objects to file and that solves the first question: why is it even possible?
But raises another question: would a TTask of any kind work in a compiled code that doesn’t make use of the dictionaries?
And more importantly for the common use one does of the class. Is it the assignment operator really wrong and not to be used or is it that just an outdated comment in the documentation?

PS Reading one of the link you gave me to previous forum discussion I understand it’s a workaround in ACLIC/ROOTCINT to solve some other problem.
I just hope that when the solution to these problem (probably in the migration to cling/clang) is found the current code will not break down