|
From: Per W. <pw...@ia...> - 2003-07-29 18:46:26
|
It is valid in the sense that a class shouldn't implement a lot of type
conversions just because it can. It should still be up to the user to
perorm any typecasts from int to xx.
Normally, operator type() is used to perform type-conversions that may not
be performed by a single type-cast - converting an integer to a string, or
an object that encapsulates several sub-objects, for example:
class CSurfInfo;
class CVec3;
class CTransform;
class C3DObject {
public:
operator CSurfInfo&();
operator CTransform&();
operator CVec3&();
};
C3DObject *pObj;
...
setSurface((CSurfInfo*)*pObj);
/Per W
On Tue, 29 Jul 2003, 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
>
|