Article View: comp.std.c++
Article #151Re: Answers on a postcard
From: Tom O Breton
Date: Sat, 12 Sep 1992 17:19
Date: Sat, 12 Sep 1992 17:19
25 lines
977 bytes
977 bytes
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)
Technical Details
Message-ID:
<BuH6sK.54r@world.std.com>Path:
arc1-ca.pugleaf.net!sparky!uunet!world!tobReferences:
<92255.154216KKEYTE@ESOC.BITNET>Show Full Headers
Complete Article Headers
Newsgroups: comp.std.c++ Path: arc1-ca.pugleaf.net!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