Path: utzoo!utgpu!jarvis.csri.toronto.edu!mailrus!cs.utexas.edu!uunet!mcsun!sunic!tut!tukki!sakkinen From: sakkinen@tukki.jyu.fi (Markku Sakkinen) Newsgroups: comp.lang.c++ Subject: Re: ++ bug ? Message-ID: <1568@tukki.jyu.fi> Date: 20 Oct 89 08:48:50 GMT References: <6590302@hplsla.HP.COM> <126542@sun.Eng.Sun.COM> <1462@tukki.jyu.fi> Reply-To: sakkinen@jytko.jyu.fi (Markku Sakkinen) SAKKINEN@FINJYU.bitnet (alternative) Organization: University of Jyvaskyla, Finland Lines: 29 In article <126542@sun.Eng.Sun.COM> bitbug (James Buster) writes: -In article <6590302@hplsla.HP.COM> jima@hplsla.HP.COM (Jim Adcock) writes: ->It is well documented almost everywhere that when overloading pre/post inc/dec ->that C++ does not distinguish between pre and post. Hence the discussion ->on @++ vs ++@ - -In "The C++ Programming Language, by Bjarne Stroustrup", on page 171, it says: - - "When the operators ++ and -- are overloaded, it is not possible to - distinguish prefix application from postfix application" - -I interpreted this to mean that the *member function* cannot distinguish -between prefix and postfix application, but that the compiler will ensure -that the member function will be called at the appropriate time (vis' a vis' -prefix or postfix application). I believe that this is the most reasonable -thing to do. Unfortunately, your interpretation is wrong. A longer reflection will show that "calling at the appropriate time" would not be quite enough. There was a longer explanation in my article referred to in the header; I assume you had not seen it when posting yours. Markku Sakkinen Department of Computer Science University of Jyvaskyla (a's with umlauts) Seminaarinkatu 15 SF-40100 Jyvaskyla (umlauts again) Finland