Compound assignment operators

Jonathan M Davis jmdavisprog at gmail.com
Thu Aug 26 02:01:38 PDT 2010


On Wednesday 25 August 2010 23:49:27 Yao G. wrote:
> On Thu, 26 Aug 2010 01:46:02 -0500, Jonathan M Davis
> 
> <jmdavisprog at gmail.com> wrote:
> > Look at http://www.digitalmars.com/d/2.0/operatoroverloading.html (or
> > even
> > better, TDPL). The correct function would be opOpAssign. I believe that
> > the
> > syntax for += would be
> > 
> > opOpAssign!("+")(args) { }
> > 
> > - Jonathan M Davis
> 
> Ha ha ha! What a shame, I was reading that page looking for a solution,
> but it seems that I just skipped that part. Thanks and sorry for the
> stupid question.

Yeah, well. It's a sparse page, and that section is quite small, so it's pretty 
easy to miss. Really, at this point, TDPL is the place to go to look stuff up 
unless it's Phobos-specific stuff.

- Jonathan M Davis


More information about the Digitalmars-d-learn mailing list