On Friday, 28 April 2017 at 22:11:30 UTC, H. S. Teoh wrote:
On Fri, Apr 28, 2017 at 05:11:29PM -0400, Nick Sabalausky (Abscissa) via Digitalmars-d-announce wrote:
On 04/28/2017 04:26 PM, Atila Neves wrote:
> The other day I was reminded that in C++ land one has to > manually write `operator<<` to print things out and > `operator==` to compare things.

Not to mention you have to overload operator<, operator!=, operator==, operator>, operator<=, *and* operator>= in order to get the right results in all cases.

In D, you have to overload opEquals and opCmp. Hmm, I wonder why I enjoy programming in D more than C++...

Comparison is better in C++. This is a weak spot in D. You could do the same in C++ as D if you wanted to. You can detect the presence of operator< in overload templates, but being explicit is not much work and more flexible. Just cut'n'paste the set you want...
            • ... Timon Gehr via Digitalmars-d-announce
              • ... Ola Fosheim Grøstad via Digitalmars-d-announce
              • ... Nick Sabalausky (Abscissa) via Digitalmars-d-announce
              • ... Timon Gehr via Digitalmars-d-announce
  • Re: "Competitiv... XavierAP via Digitalmars-d-announce
    • Re: "Compe... Atila Neves via Digitalmars-d-announce
      • Re: "C... Nick Sabalausky (Abscissa) via Digitalmars-d-announce
        • Re: &qu... H. S. Teoh via Digitalmars-d-announce
        • Re: &qu... Ali Çehreli via Digitalmars-d-announce
          • Re:... Nick Sabalausky (Abscissa) via Digitalmars-d-announce
        • Re: &qu... Ola Fosheim Grostad via Digitalmars-d-announce
        • Re: &qu... Nick Sabalausky (Abscissa) via Digitalmars-d-announce
          • Re:... Ola Fosheim Grøstad via Digitalmars-d-announce
        • Re: &qu... Patrick Schluter via Digitalmars-d-announce
          • Re:... Ola Fosheim Grøstad via Digitalmars-d-announce
            • ... Patrick Schluter via Digitalmars-d-announce
              • ... Ola Fosheim Grøstad via Digitalmars-d-announce
              • ... Adam D. Ruppe via Digitalmars-d-announce
          • Re:... H. S. Teoh via Digitalmars-d-announce

Reply via email to