From -6148749891120643713
X-Google-Thread: 7894ca11fe,2030f7dfcae4edfc
X-Google-Attributes: gid7894ca11fe,public,usenet
X-Google-NewGroupId: yes
X-Google-Language: ENGLISH,ASCII-7-bit
Received: by 10.180.107.38 with SMTP id gz6mr1305092wib.0.1349861101924;
        Wed, 10 Oct 2012 02:25:01 -0700 (PDT)
MIME-Version: 1.0
Path: q11ni134257633wiw.1!nntp.google.com!feeder3.cambriumusenet.nl!feed.tweaknews.nl!85.12.40.130.MISMATCH!xlned.com!feeder1.xlned.com!newsfeed.xs4all.nl!newsfeed5.news.xs4all.nl!xs4all!newspeer1.nac.net!news.mi.ras.ru!goblin3!goblin.stu.neva.ru!inn5.news.alteholz.net!easy.in-chemnitz.de!news2.arglkargh.de!news.albasani.net!.POSTED!not-for-mail
From: James Kuyper <jameskuyper@verizon.net>
Newsgroups: comp.std.c++
Subject: Re: What's a "side effect"
Date: Sun,  7 Oct 2012 07:43:20 -0700 (PDT)
Organization: A noiseless patient Spider
Lines: 33
Sender: std-cpp-request@vandevoorde.com
Approved: stephen.clamage@oracle.com
Message-ID: <506F093C.1000505@verizon.net>
References: <506de288$0$71204$742ec2ed@news.sonic.net>
NNTP-Posting-Host: knGK2qp0XjJ+k+vgMVD7EGI9dqjttxOKYzFC1pWfrno=
X-Trace: news.albasani.net /ESBdyDme0gHIuftq3xhXndyT5rjqG7REuwTcngR0bH9DbAUAl6/dwsc38f3RQkkgT+PJbZ/b19DXLsF1GqcfQ==
X-Complaints-To: abuse@albasani.net
NNTP-Posting-Date: Sun, 7 Oct 2012 14:43:27 +0000 (UTC)
X-Mailer: Perl5 Mail::Internet v2.05
X-Submission-Address: std-cpp-submit@vandevoorde.com
Cancel-Lock: sha1:CZrstWHmAFQPw0wLQpEkv5BEpdY=
X-Original-Date: Fri, 05 Oct 2012 12:22:20 -0400
Content-Type: text/plain; charset=ISO-8859-1

On 10/05/2012 04:35 AM, Andy Lutomirski wrote:
>
> I'm trying to userstand the memory model.  [intro.multithread] mentions
> lots of things like:
>
> A release sequence ... is a maximal contiguous sub-sequence of side effects
>
> I know what a /visible/ side effect is (see #13), but that doesn't tell
> me what a side effect is in the first place.  I assume that a "side
> effect" is just a write (e.g. "a = b" has a side effect of modifying a),
> but AFAICS the N3376 has no language to support that assumption.
>
> Am I right?  Should I submit a defect report?

You're right - the expression "a = b" does have a side effect, which is
the modification of the object identified by "a" (unless a very peculiar
operator overload applies). However, there are other kinds of side
effects that don't fit your description:

"Accessing an object designated by a volatile glvalue (3.10), modifying
an object, calling a library I/O function, or calling a function that
does any of those operations are all side effects, ..." (1.9p12) The
phrase "side effects" is italicized in that sentence, which is an ISO
convention for indicating that the sentence containing that phrase
constitutes the definition of that phrase.



-- 
[ comp.std.c++ is moderated.  To submit articles, try posting with your ]
[ newsreader.  If that fails, use mailto:std-cpp-submit@vandevoorde.com ]
[              --- Please see the FAQ before posting. ---               ]
[ FAQ: http://www.comeaucomputing.com/csc/faq.html                      ]


