| Thread overview | |||||
|---|---|---|---|---|---|
|
April 08, 2013 operator += | ||||
|---|---|---|---|---|
| ||||
How can I define operator += for a struct? | ||||
April 08, 2013 Re: operator += | ||||
|---|---|---|---|---|
| ||||
Posted in reply to Minas Mina | On 2013-04-08, 14:23, Minas Mina wrote: > How can I define operator += for a struct? http://dlang.org/operatoroverloading.html In short: struct S { auto opOpAssign( string op : "+" )( S other ) { // Do stuff here. } } -- Simen | |||
April 08, 2013 Re: operator += | ||||
|---|---|---|---|---|
| ||||
Posted in reply to Simen Kjaeraas | On Monday, 8 April 2013 at 12:37:34 UTC, Simen Kjaeraas wrote:
> On 2013-04-08, 14:23, Minas Mina wrote:
>
>> How can I define operator += for a struct?
>
> http://dlang.org/operatoroverloading.html
>
> In short:
>
> struct S {
> auto opOpAssign( string op : "+" )( S other ) {
> // Do stuff here.
> }
> }
Thanks a lot.
| |||
Copyright © 1999-2021 by the D Language Foundation
Permalink
Reply