[Issue 2657] Remove opPostInc, opPostDec

2015-06-09 Thread via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=2657

Andrei Alexandrescu and...@erdani.com changed:

   What|Removed |Added

Version|unspecified |D2

--


[Issue 2657] Remove opPostInc, opPostDec

2010-06-01 Thread d-bugmail
http://d.puremagic.com/issues/show_bug.cgi?id=2657


Don clugd...@yahoo.com.au changed:

   What|Removed |Added

 Status|NEW |RESOLVED
 Resolution||FIXED


--- Comment #4 from Don clugd...@yahoo.com.au 2010-06-01 07:08:27 PDT ---
The postincrement and postdecrement operators should be redefined in terms of
the preincrement operator.

Implemented in DMD2.041. (though not in the form suggested in this bug report).

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
--- You are receiving this mail because: ---


[Issue 2657] Remove opPostInc, opPostDec

2010-06-01 Thread d-bugmail
http://d.puremagic.com/issues/show_bug.cgi?id=2657


Andrei Alexandrescu and...@metalanguage.com changed:

   What|Removed |Added

 CC||and...@metalanguage.com


--- Comment #5 from Andrei Alexandrescu and...@metalanguage.com 2010-06-01 
07:12:00 PDT ---
Perfect. Is it a solution indistinguishable from that described in TDPL?

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
--- You are receiving this mail because: ---


[Issue 2657] Remove opPostInc, opPostDec

2010-06-01 Thread d-bugmail
http://d.puremagic.com/issues/show_bug.cgi?id=2657



--- Comment #6 from Don clugd...@yahoo.com.au 2010-06-01 08:49:06 PDT ---
(In reply to comment #5)
 Perfect. Is it a solution indistinguishable from that described in TDPL?

Yes. The solution in DMD and TDPL is more complete than I proposed.
I proposed to just make it illegal to use the return value. The solution we
have now creates a temporary copy to return. Bug 4231 remains; the solution to
that would be to not create the temporary if the return value isn't required.
As a side-effect, this will give us optimal performance g.

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
--- You are receiving this mail because: ---


[Issue 2657] Remove opPostInc, opPostDec

2010-06-01 Thread d-bugmail
http://d.puremagic.com/issues/show_bug.cgi?id=2657



--- Comment #7 from Andrei Alexandrescu and...@metalanguage.com 2010-06-01 
08:59:29 PDT ---
Great. The spurious creation of an extra value is important, so I suggest you
keep this bug open or open a different one. Thanks!

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
--- You are receiving this mail because: ---


[Issue 2657] Remove opPostInc, opPostDec

2009-02-13 Thread d-bugmail
http://d.puremagic.com/issues/show_bug.cgi?id=2657





--- Comment #1 from schvei...@yahoo.com  2009-02-13 10:37 ---
I use it in dcollections iterators to do increment and decrement, sometimes I
use the return value (which is a copy of the iterator before incrementing).

However, I wouldn't mind getting rid of opPostInc *if* opInc was a true
operator, instead of the hackish += 1, which makes no sense for iterators.  I
have to put warning comments in the opAddAssign saying you should only call it
via ++i, because doing i += x can be an O(n) operation.

Yes, I know I could implement these as functions instead of operators, but the
syntax is so perfect for it, and it seamlessly fits with pointers.


--