public inbox for gcc-help@gcc.gnu.org
 help / color / mirror / Atom feed
From: Gianni Mariani <marianig@orconet.com>
To: Lei Ming <l.ming@auckland.ac.nz>
Cc: gcc-help@gcc.gnu.org
Subject: Re: c++ post and pre increment operators - slightly off topic
Date: Thu, 27 Jul 2000 11:12:00 -0000	[thread overview]
Message-ID: <39807BA0.766F88D8@orconet.com> (raw)
In-Reply-To: <397F7B42.3DB7C9D7@auckland.ac.nz>

Excellent idea - tried it - no luck - article -
97DF3CB.F0B9F9AB%40orconet.com .

I thought that the semanic was that the operator was a
"side effect", hence the method should be called after the
expression was evaluated.  My bad.  Hence I thought
it was a compiler boog.

my *bad* assumption was that :

    y = z ++ + z ++ should be the same as (y = z + z), z++, z++

I could not find any reference to the contrary.  I did RTFM.

Lei Ming wrote:

> Hi,
>
> You post your question to wrong place. You should go to c++ news group.
>
> Post increment did go before reference. The problem is your
> implementation.
> In "foo operator ++(int num)", you should return the old value not the new
>
> value. That is the semantic meaning of post increment.
>
> Lei

      reply	other threads:[~2000-07-27 11:12 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2000-07-25 17:57 Gianni Mariani
2000-07-26  5:25 ` llewelly
2000-07-26 16:59 ` Lei Ming
2000-07-27 11:12   ` Gianni Mariani [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=39807BA0.766F88D8@orconet.com \
    --to=marianig@orconet.com \
    --cc=gcc-help@gcc.gnu.org \
    --cc=l.ming@auckland.ac.nz \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).