From -5598510640586535313
X-Google-Thread: f78e5,d807f402b53e9296,start
X-Google-Attributes: gidf78e5,public
X-Google-Language: ENGLISH,ASCII-7-bit
Path: g2news1.google.com!news2.google.com!newsread.com!news-xfer.newsread.com!news.alt.net!comp-std-cpp-robomod!not-for-mail
From: "ScottM" <scott@mayo.name>
Newsgroups: comp.std.c++
Subject: overriding postfix operator
Date: 24 Jul 2005 21:40:02 GMT
Organization: http://groups.google.com
Lines: 20
Approved: Fergus Henderson <fjh@cs.mu.oz.au>, moderator of comp.std.c++
Message-ID: <1122152522.719764.325240@z14g2000cwz.googlegroups.com>
Mime-Version: 1.0
Content-Type: text/plain; charset="iso-8859-1"
Return-Path: <devnull@stump.algebra.com>
X-Authentication-Warning: mulga.cs.mu.OZ.AU: fjh set sender to devnull@stump.algebra.com using -f
X-Robomod: STUMP, ichudov@algebra.com (Igor Chudov)
Delivered-To: std-c++@ucar.edu
X-Trace: posting.google.com 1122152528 6224 127.0.0.1 (23 Jul 2005 21:02:08 GMT)
X-Complaints-To: groups-abuse@google.com
NNTP-Posting-Date: Sat, 23 Jul 2005 21:02:08 +0000 (UTC)
User-Agent: G2/0.2
Complaints-To: groups-abuse@google.com
Injection-Info: z14g2000cwz.googlegroups.com; posting-host=199.46.198.234;
   posting-account=_FL1Xg0AAADPI1QCuujJrMgLpVIwNb4q
X-Virus-Scanned: amavisd-new at ucar.edu
X-Virus-Scanned: amavisd-new at cs.mu.OZ.AU
X-Virus-Scanned: amavisd-new at cs.mu.OZ.AU
Xref: g2news1.google.com comp.std.c++:1471

I find people new to C++ tend to avoid overriding the postfix operators
(++, etc.) because the syntax is bizarre. I'm wondering if an alternate
syntax (I realise there is no good syntax for this) might help:

   operator ++      //prefix
   operator ++...   //prefix
   operator ...++   //postfix

where ... is the '...' token, which as far as I can tell can't
otherwise be here.

I find an amusing, gentle irony in that fact that the expression c++ is
curiously hard to override in C++.  :-)

---
[ comp.std.c++ is moderated.  To submit articles, try just posting with ]
[ your news-reader.  If that fails, use mailto:std-c++@ncar.ucar.edu    ]
[              --- Please see the FAQ before posting. ---               ]
[ FAQ: http://www.jamesd.demon.co.uk/csc/faq.html                       ]



