[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
overload arithmetic assignment operators?
From: |
Steve White |
Subject: |
overload arithmetic assignment operators? |
Date: |
Fri, 24 Dec 2010 00:05:20 +0100 |
Hi,
I gather from
http://www.gnu.org/software/octave/doc/interpreter/Assignment-Ops.html
and
http://www.gnu.org/software/octave/doc/interpreter/Operator-Overloading.html
that there is no way in octave to directly overload arithmetic assignment
operators (+=, *=, etc.);
evidently the assignment operators are based on the binary arithmetic ones.
This is really a pity, efficiency-wise, for classes that might use these
operators.
The binary operators typically require the constructon of a new class object,
while assignment operators don't. If efficiency were important, then the binary
operators should by default be defined in terms of the arithmetic assignment
operators.
What do you think?
Is it worth a wish?
- overload arithmetic assignment operators?,
Steve White <=