RE:CINT and operator->

From: Masaharu Goto (MXJ02154@nifty.ne.jp)
Date: Sun Jan 23 2000 - 22:23:35 MET


Hello George,

Thank you for reporting this problem.

This is a known cint limitation. Cint does not allow overloading -> operator.
It is possible to enhance this in cint, however, there is a problem for
existing root application.  Some of the existing macro depends on current
cint behavior. 

I will implement overloading of operator-> in pure cint 5.14.28. However 
this feature will not be turned on for root to keep backward compatibility.

Masaharu Goto


>
>Hi rooters.
>
> I have a class (call it MyIter) on which I define operator->(). This 
>is a specific iterator class to be fast and handle typesafety, and 
>overloading operator->() is normal and natural for such classes.
>
>If I do MyIter y; y->Function(), in C++ this is turned into something 
>like:
>
>(y.operator->())->Function()
>
>where y.operator->() returns a pointer to an object of some other class.
>
>but in CINT, it looks like we are running into CINT's extension of 
>allowing the equivalence of . and ->, and it tells me that Function() 
>is not a member of class MyIter.
>
>It would be very nice if CINT would just check first to see if 
>operator-> is defined on the class, and if so use C++ semantics for it, 
>before using the extension to the language.
>
>George Heintzelman
>gah@bnl.gov
>
>



This archive was generated by hypermail 2b29 : Tue Jan 02 2001 - 11:50:17 MET