[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[ePiX-devel] Re: [ePiX-users] Stable release (Version 1.2.0)
From: |
Andrew D. Hwang |
Subject: |
[ePiX-devel] Re: [ePiX-users] Stable release (Version 1.2.0) |
Date: |
Wed, 26 Sep 2007 10:55:38 -0400 (EDT) |
On Wed, 26 Sep 2007, Maik Beckmann wrote:
I'm wondering about the binary operators like
<triple.cc>
...
P operator+ (P u, const P& v)
{
return u += v;
}
...
</triple.cc>
I think this is a trap, because the following is what the most people expect:
P operator+ (P const& u, const P& v)
{
P tmp(u);
return tmp += v;
}
like epix-1.0.x does.
Dear Maik,
Thank you for your emails. I've added <cstdlib> to debug.h and
interval.cc, but will wait to upload 1.2.0-2 until this operator
issue is discussed. (I've cc-ed the devel list, and suggest we
continue there. :)
As I understand it, the new syntax accepts the same arguments as the old
(so is not more restrictive to the user), and is slightly more efficient:
Both implementations copy u, but the second carries the small overhead of
passing a const reference for the first argument. Please let me know if
this is incorrect, particularly, if there are argument types that work as
expected with the old syntax but not with the new.
As a quick check, this snippet worked correctly on my test platforms:
const P arg1(1,2);
const P& arg1b(arg1);
const P arg2(2,0);
P sum1(arg1 + arg2);
P sum1b(arg1b + arg2);
Best,
Andy
Andrew D. Hwang address@hidden
Department of Math and CS http://mathcs.holycross.edu/~ahwang
College of the Holy Cross (508) 793-2458 (Office: 320 Swords)
Worcester, MA, 01610-2395 (508) 793-3530 (fax)
- [ePiX-devel] Re: [ePiX-users] Stable release (Version 1.2.0),
Andrew D. Hwang <=