Summary: Provide canonical example for operator overloading
           Product: D
           Version: 2.041
          Platform: All
        OS/Version: All
            Status: NEW
          Keywords: spec
          Severity: normal
          Priority: P1

--- Comment #0 from Jerry Quinn <> 2010-03-19 23:19:43 PDT 
At first glance, the new operator overloading syntax looks cumbersome by
comparison to C++.  Adding the following example to the D docs would make it
clear what the advantage of the new syntax is, as well as not requiring people
to reinvent it repeatedly:

2. Use one mixin expression:

T opBinary(string op)(T rhs) {
     return mixin("data "~op~"");

Configure issuemail:
------- You are receiving this mail because: -------

Reply via email to