Ambiguous overload resolution

From: Monika Sharma <monika_at_rcf.rhic.bnl.gov>
Date: Fri, 5 Dec 2008 12:17:50 -0500

Hi Everyone,

I was happily adding an integer to a TString so far in ROOT. Following is a very simple example of what I used to do.



TString hname = "c3_02pt2_Z25_Inclusive_"; TString hname1 = "c2_02pt2_Z25_AuAu200";
Int_t i=1;
hname1 = hname+i;

===========================================

Lately I upgraded ROOT to ROOT 5.21/07 (trunk_at_26568, Dec 01 2008, 17:44:51 on macosx64)
and I can't seem to be able to use this operator anymore. Instead I get the following error message....



Error: Ambiguous overload resolution (10001,3) DeltaPtPtInclusive.C:107: Calling : operator+(TString,Int_t);
Match rank: file line signature
  ffffffff /Applications/root/lib/libGraf.so -1 TImage operator+(const TImage&,const TImage&);
  ffffffff /Applications/root/lib/libHist.so -1 TH3D operator+(TH3D&,TH3D&);
  ffffffff /Applications/root/lib/libHist.so -1 TH3F operator+(TH3F&,TH3F&);

So now instead of doing the above operation, if I do the following, it works fine.

hname1 = hname;
hname1 += i;

However, I don't want to do this way. I still want to be able to use a simple operation of TString+int.

Is there still a way to do it?

Regards
Monika Received on Fri Dec 05 2008 - 18:18:27 CET

This archive was generated by hypermail 2.2.0 : Fri Dec 05 2008 - 23:50:02 CET