|
From: Graham D. <g.d...@nt...> - 2003-07-29 20:15:16
|
Actually, I thought your first answer was absolutely correct. Hardly anything in the original post suggested that tho OP was trying to implement conversion operators. The OP asked about overloading operator() and the sample code showed an attempt to overload operator(), since there were two sets of parentheses shown, and the word operator came after the type. When I read it, I assumed that this was simply an inappropriate use of operator() to do some type conversion. I.e. I though that the intent was to use it as: CNumber n; char c = n(); // attempt to call char CNumber::operator()(); long l = n(); // attempt to call long CNumber::operator()(); Doomed to failure, of course, because, as you pointed out, you can't overload on return type and also because using operator() in this way is wholly inappropriate. Abhijit Shylanath wrote: >>operator unsigned char() >> >>The return value is the type. >> >> > >Okay, so my post (argument list should be different, not return type) isn't >valid, I guess. Sorry. > >-- >Abhijit Shylanath >Homepage: http://mudeth.tripod.com/ > > > >------------------------------------------------------- >This SF.Net email sponsored by: Free pre-built ASP.NET sites including >Data Reports, E-commerce, Portals, and Forums are available now. >Download today and enter to win an XBOX or Visual Studio .NET. >http://aspnet.click-url.com/go/psa00100003ave/direct;at.aspnet_072303_01/01 >_______________________________________________ >Dev-cpp-users mailing list >Dev...@li... >TO UNSUBSCRIBE: http://www23.brinkster.com/noicys/devcpp/ub.htm >https://lists.sourceforge.net/lists/listinfo/dev-cpp-users > > > |