[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: base constructor
From: |
Thomas Maeder |
Subject: |
Re: base constructor |
Date: |
Thu, 09 Mar 2006 17:50:32 +0100 |
User-agent: |
Gnus/5.1006 (Gnus v5.10.6) XEmacs/21.4 (Jumbo Shrimp, linux) |
"solid" <tmuldner@gmail.com> writes:
> Thanks, but I don't see any side-effects in my program...
This copy constructor
A(const A& a) { b_ = !a.b_; }
can be called humorous at best.
Since the compiler is entitled to optimize away its invokation in
certain situations, there's now way to predict whether you deal with
an original or a copy of it (with the value of b_ negated) [leaving
open the question whether the terms "original" and "copy" should be
used here].