On Friday, 28 February 2020 at 06:12:37 UTC, Виталий Фадеев wrote:
How to implement ?

I would go for a template mixin that implements send operation in each subclass. Sine template mixin's content is declared in scope of declaration not template's module, the code inside it is aware of concrete implementation of your base class, and could introspect all methods available in it, and generate your switch statement (in send operation) for all supported messages.

This would be just one line of code in each class with no complication whatsoever.

Best regards,
Alexandru.
  • Re: Call method if dec... Simen Kjærås via Digitalmars-d-learn
    • Re: Call method i... Виталий Фадеев via Digitalmars-d-learn
      • Re: Call meth... drug via Digitalmars-d-learn
      • Re: Call meth... Simen Kjærås via Digitalmars-d-learn
        • Re: Call ... Виталий Фадеев via Digitalmars-d-learn
          • Re: C... Виталий Фадеев via Digitalmars-d-learn
            • ... Виталий Фадеев via Digitalmars-d-learn
              • ... Simen Kjærås via Digitalmars-d-learn
              • ... Виталий Фадеев via Digitalmars-d-learn
  • Re: Call method if dec... Alexandru Ermicioi via Digitalmars-d-learn

Reply via email to