I’m attempting to call a function in the ROOT plotting package that accepts three variables. The relevant section in my code is:
int xwidth=0,ywidth=0;
Bool_t useangle=0;
vIt->GetBoundingBox(xwidth,ywidth,useangle);
where vIt is an iterator to an object with GetBoundingBox as a class member function. (Bool_t is just a typedef that ROOT uses).
Now, when I compile, I get the following error from g++:
error: no matching function for call to ‘TText::GetBoundingBox(int&, int&, Bool_t&)’
/home/bwhelan/Programs/MODIFIED//External/root/5.30.00/include/root/TText.h:57: note: candidates are: virtual void TText::GetBoundingBox(UInt_t&, UInt_t&, Bool_t)
My question is why is useangle being passed by reference here, instead of by value? I simply cannot figure it out.
The problem isn’t that the bool is passed by reference but that you line
Should be of type
UInt_tThe compiler doesn’t know how you want to pass the variable to function with the unkown overload so it just assumes you meant by ref.