Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.std.c++ > #552

Re: What's a "side effect"

Path csiph.com!v102.xanadu-bbs.net!xanadu-bbs.net!news.mixmin.net!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> (permalink)
References <506de288$0$71204$742ec2ed@news.sonic.net>
NNTP-Posting-Host knGK2qp0XjJ+k+vgMVD7EGI9dqjttxOKYzFC1pWfrno=
Content-Type text/plain; charset=ISO-8859-1
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
Xref csiph.com comp.std.c++:552

Show key headers only | View raw


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                      ]

Back to comp.std.c++ | Previous | NextPrevious in thread | Next in thread | Find similar


Thread

What's a "side effect" Andy Lutomirski <luto@amacapital.net> - 2012-10-05 02:35 -0600
  Re: What's a "side effect" James Kuyper <jameskuyper@verizon.net> - 2012-10-07 07:43 -0700
  Re: What's a "side effect" =3D?ISO-8859-1?Q?Daniel_Kr=3DFCgler?=3D <daniel.kruegler@googlemail.c= om> - 2012-10-08 09:11 -0700

csiph-web