On Thursday, 3 January 2019 at 23:23:12 UTC, Neia Neutuladh wrote:
On Thu, 03 Jan 2019 22:30:48 +0000, kdevel wrote:
class A : D {
     int foo() { return 1; }
}

class B : A, D {
[...]

What is the meaning of the ", D"? It does not seem to make a difference if it is omitted.

B must provide its own implementation of D. It can't simply use A's implementation.

As for class B, it has already included foo(), even if it doesn't override this method. So, is it necessary to override it again? It not always needed to override foo(). Sometimes, we just want to keep it as the one in class A and override it as necessary. Honestly hope that the compiler can do this.
              • Re:... Steven Schveighoffer via Digitalmars-d-learn
              • Re:... bauss via Digitalmars-d-learn
              • Re:... Alex via Digitalmars-d-learn
          • Re: reimplem... bauss via Digitalmars-d-learn
            • Re: rei... Alex via Digitalmars-d-learn
              • Re:... Ali Çehreli via Digitalmars-d-learn
              • Re:... Alex via Digitalmars-d-learn
              • Re:... Ali Çehreli via Digitalmars-d-learn
              • Re:... Neia Neutuladh via Digitalmars-d-learn
              • Re:... Alex via Digitalmars-d-learn
    • Re: reimplementing an in... Heromyth via Digitalmars-d-learn
  • Re: reimplementing an interfa... bauss via Digitalmars-d-learn

Reply via email to