TCut and the ! operator

I thought I would try to make a more complete [color=Brown]! operator[/color] for the object
TCut in root. The current version looks like this:

// in TCut.cxx (which I found on the web) TCut operator!(const TCut &rhs) { if (rhs.fTitle.Length() == 0) return TCut(); TString s = "!(" + rhs.fTitle + ")"; return TCut(s.Data()); }
I would like to do something like this as I keep the [color=Brown]LaTeX[/color] version of
the cut in the [color=Red]fName[/color] string in the TCut object.

// what I would like to change it to: TCut operator!(const TCut &rhs) { if (rhs.fTitle.Length() == 0) return TCut(); TString s = "!(" + rhs.fTitle + ")"; if (rhs.fName.Length() != "CUT") { TString t = "![" + rhs.fName + "]"; return TCut(t.Data(), s.Data()); } return TCut(s.Data()); }
I tried putting this into a file and loading with the [color=red].L[/color] command at the
command line but to no avail. As when I do something like:

[0] .L load.cpp [1] TCut cut("cut name", "cut title"); [2] cout << cut.GetTitle() << endl << cut.GetName() << endl; cut title cut name [3] TCut anticut = !cut; Error: Symbol rhs is not defined in current scope FILE:load.cpp LINE:224 Error: Failed to evaluate rhs.fTitleError: Failed to evaluate rhs.fTitle.Length()Possible candidates are... filename line:size busy function type and name *** Interpreter error recovered ***
I am running on [color=blue]RedHat 9 with root 3.10/02[/color].
Can I get this to work somehow?

I found this after some searching via google actually. Notice that the implementation by Fons did not include the fName part of the example suggested by Andrei as shown below.

Also, there is an inconsistency in the && and || operators with the TCut as well:

root [0] TCut one("onename","onetitle");
root [1] TCut two("twoname","twotitle");
root [2] TCut three = one && two;
root [3] three.Print();
OBJ: TCut       onename (onetitle)&&(twotitle)
root [4] TCut four = one || two;
root [5] four.Print();
OBJ: TCut       CUT     (onetitle)||(twotitle)
root [6] TCut five = !one && two;
root [7] five.Print();
OBJ: TCut       CUT     (!(onetitle))&&(twotitle)

None of the above operators handle the fName properly if at all!
[color=red]Is there a way to redefine these operators in a header function that I can load via the .L command?[/color]