Thread overview
[Issue 3988] New: Provide canonical example for operator overloading
Mar 20, 2010
Jerry Quinn
Jan 24, 2012
Walter Bright
March 20, 2010
http://d.puremagic.com/issues/show_bug.cgi?id=3988

           Summary: Provide canonical example for operator overloading
           Product: D
           Version: 2.041
          Platform: All
               URL: http://digitalmars.com/d/2.0/operatoroverloading.html
        OS/Version: All
            Status: NEW
          Keywords: spec
          Severity: normal
          Priority: P1
         Component: www.digitalmars.com
        AssignedTo: nobody@puremagic.com
        ReportedBy: jlquinn@optonline.net


--- Comment #0 from Jerry Quinn <jlquinn@optonline.net> 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:

http://www.digitalmars.com/webnews/newsgroups.php?art_group=digitalmars.D&article_id=101636

2. Use one mixin expression:

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

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
January 24, 2012
http://d.puremagic.com/issues/show_bug.cgi?id=3988



--- Comment #1 from github-bugzilla@puremagic.com 2012-01-23 17:36:39 PST ---
Commit pushed to https://github.com/D-Programming-Language/d-programming-language.org

https://github.com/D-Programming-Language/d-programming-language.org/commit/ed45694454cf1510110d1ac57308841213c89780 fix Issue 3988 - Provide canonical example for operator overloading

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
January 24, 2012
http://d.puremagic.com/issues/show_bug.cgi?id=3988


Walter Bright <bugzilla@digitalmars.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |RESOLVED
                 CC|                            |bugzilla@digitalmars.com
         Resolution|                            |FIXED


-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------