home *** CD-ROM | disk | FTP | other *** search
- Newsgroups: comp.std.c++
- Path: sparky!uunet!world!tob
- From: tob@world.std.com (Tom O Breton)
- Subject: Re: Answers on a postcard
- Message-ID: <BuH6sK.54r@world.std.com>
- Organization: The World Public Access UNIX, Brookline, MA
- References: <92255.154216KKEYTE@ESOC.BITNET>
- Date: Sat, 12 Sep 1992 17:19:31 GMT
- Lines: 25
-
- Karl:
-
- > If not, I would ask: How does one overload the comma operator while
- > maintaining its attibutes as an operator?
-
-
- It's of dubious usefulness but it can be done:
-
- class thisclass
- { int& operator,(int a); }
-
- //To call this: (thisclass)X, (int)Y ... (outside of arg-lists, of course)
-
- This will return you an int, just as if the default comma operator had
- executed.
-
-
- In general, chain operators by returning references (Usually to the same
- argument they took).
-
- Tom
-
- --
- The Tom spreads its huge, scaly wings and soars into the wild sky...
- up... up... out of sight... (tob@world.std.com)
-