On Mon, Dec 30, 2013 at 05:34:10AM +0100, Marco Leise wrote:
> Am Sat, 28 Dec 2013 15:24:31 +
> schrieb "Dicebot" :
>
> > AFAIK it is intentionally banned to constrain operator
> > overloading abuse.
>
> That and it makes the compiler faster.
[...]
And discourages writing unreadable code li
Am Sat, 28 Dec 2013 15:24:31 +
schrieb "Dicebot" :
> AFAIK it is intentionally banned to constrain operator
> overloading abuse.
That and it makes the compiler faster.
--
Marco
On Saturday, 28 December 2013 at 20:06:46 UTC, H. S. Teoh wrote:
On Sat, Dec 28, 2013 at 07:35:00PM +0100, Joseph Rushton
Wakeling wrote:
On 28/12/13 18:50, John Colvin wrote:
>how about:
>
>a.elementWise * b
>
>where a.elementWise returns a wrapper struct around a that
>implements
>elementwis
On Sat, Dec 28, 2013 at 07:35:00PM +0100, Joseph Rushton Wakeling wrote:
> On 28/12/13 18:50, John Colvin wrote:
> >how about:
> >
> >a.elementWise * b
> >
> >where a.elementWise returns a wrapper struct around a that implements
> >elementwise arithmetic as opposed to the normal arithmetic.
> >
> >
On 28/12/13 18:50, John Colvin wrote:
how about:
a.elementWise * b
where a.elementWise returns a wrapper struct around a that implements
elementwise arithmetic as opposed to the normal arithmetic.
The operators would return instances of Matrix, not elementWise, to avoid
accidentally spilling a
On Saturday, 28 December 2013 at 16:33:24 UTC, Joseph Rushton
Wakeling wrote:
On 28/12/13 16:24, Dicebot wrote:
AFAIK it is intentionally banned to constrain operator
overloading abuse.
Ahh, makes sense. But isn't it possible to do something with
templates that would allow for something like
On 28/12/13 16:24, Dicebot wrote:
AFAIK it is intentionally banned to constrain operator overloading abuse.
Ahh, makes sense. But isn't it possible to do something with templates that
would allow for something like,
auto a = matrix(...);
auto b = matrix(...);
auto c = ElementWi
AFAIK it is intentionally banned to constrain operator
overloading abuse.
Is there any way with D to define custom binary operators for user-defined
types? I'm thinking of examples like MATLAB/Octave using the operators .+, .-,
etc. to define element-wise addition, subtraction, etc. of matrices.
AFAICS just doing something like
auto opBinary(string op,