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"); }
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
AltStyle によって変換されたページ (->オリジナル) / アドレス: モード: デフォルト 音声ブラウザ ルビ付き 配色反転 文字拡大 モバイル