Re: Using opOpAssign, cannot assign sequence

2019-04-05 Thread Paul Backus via Digitalmars-d-learn
On Friday, 5 April 2019 at 13:59:27 UTC, Alex wrote: class X(T) void opOpAssign(string op)(T d) If T has more than length of one then x += We can work around this but it seems to me that we should be able to get it to work in some way x += Alias!(a,b,c) fails to package it up

Re: Using opOpAssign, cannot assign sequence

2019-04-05 Thread ag0aep6g via Digitalmars-d-learn
On 05.04.19 16:00, Alex wrote: I was thinking using tuple would work(of course is longer than Add but would allow for a more general approach, it would require automatic unpacking though and so doesn't work. `tuple` works for me: import std.typecons: tuple; class X(T ...) { void opO

Re: Using opOpAssign, cannot assign sequence

2019-04-05 Thread Alex via Digitalmars-d-learn
On Friday, 5 April 2019 at 13:59:27 UTC, Alex wrote: class X(T) void opOpAssign(string op)(T d) If T has more than length of one then x += We can work around this but it seems to me that we should be able to get it to work in some way x += Alias!(a,b,c) fails to package it up