Newsgroups: comp.lang.c++ Path: utzoo!utgpu!news-server.csri.toronto.edu!torsqnt!geac!alias!rae From: rae@alias.com (Reid Ellis) Subject: Re: Overloading typecast Message-ID: <1991Jun27.235416.16326@alias.com> Keywords: overloading operators typecasting Sender: news@alias.com (0000-news(0000)) Organization: Alias Research, Inc., Toronto ON Canada References: Date: Thu, 27 Jun 1991 23:54:16 GMT Daniel Mark Gessel writes: |I have seen: |class X { | public: | overload char *() |} |meaning overload the (char *) operator so that (char *)X can be meaningful. I think you mean: struct X { operator char *() }; [I prefer "struct" to "class"..] You can use "operator" methods to provide user-defined conversions to/from user-defined and other types. Reid -- Reid Ellis rae@utcs.toronto.edu || rae@alias.com CDA0610@applelink.apple.com || +1 416 362 9181 [work]