|
From: Ioannis V. <iv...@em...> - 2003-07-30 08:06:57
|
> -----Original Message----- > From: Marc Heiligers [mailto:ma...@e-...]=20 > Sent: Wednesday, July 30, 2003 8:07 AM > To: 'Per Westermark'; 'Abhijit Shylanath' > Cc: 'Ioannis Vranos'; dev...@li... > Subject: RE: [Dev-C++] Overloading ()() >=20 >=20 > Hi All, >=20 > As I said, the example was contrived and not useful. Casting=20 > to different > int types is not what I had in mind, but it served to get the question > across without declaring 10 different classes and overloading the type > operator. Anyway thanks for the input, everybody. Ioannis' answer was > correct, although it was so brief I had to read it ten times before I > understood what he meant. I have been very busy these last days that essentially I haven't read = any emails on this thread since my answer. I saw that type casts were = mentioned in the mean time. What casts?! These "type conversions" are not to be used regularily, but only in = specific cases when doing otherwise introduces significant disadvantages. Use encapsulation and abstraction for the usual stuff (access via member functions and stuff). You will find that in most cases that the implicit type conversions you = need will occur via the implicit calls of constructors and the creation of temporaries (which sometimes we wish to avoid thus the use of the = keyword explicit, but that's another story). Ioannis Vranos =20 * Programming pages: http://www.noicys.freeurl.com * Alternative URL 1: http://run.to/noicys * Alternative URL 2: http://www.noicys.cjb.net |