On Saturday, 23 July 2016 at 21:44:05 UTC, Rufus Smith wrote:
Templates are not the end all be all. They don't allow for run-time polymorphism, which is an important aspect of software.

Ok, so you need runtime polymorphism. And you want it in @nogc code. That's not difficult. Just have the base class of your hierarchy declare its opXXX @nogc. This is possible, because non-@nogc functions can be overridden by @nogc ones (as logical). Now you can have your function accept parameters of your base class, and it will be @nogc. And without forcing every class of the D world to have opXXX @nogc.
I don't see why this wouldn't be enough...
  • Cannot compare object.opEqual... Rufus Smith via Digitalmars-d-learn
    • Re: Cannot compare objec... Lodovico Giaretta via Digitalmars-d-learn
      • Re: Cannot compare o... Rufus Smith via Digitalmars-d-learn
        • Re: Cannot compa... Lodovico Giaretta via Digitalmars-d-learn
        • Re: Cannot compa... Steven Schveighoffer via Digitalmars-d-learn
          • Re: Cannot c... Jonathan Marler via Digitalmars-d-learn
            • Re: Can... Jonathan Marler via Digitalmars-d-learn
              • Re:... Lodovico Giaretta via Digitalmars-d-learn
                • ... Rufus Smith via Digitalmars-d-learn
                • ... Lodovico Giaretta via Digitalmars-d-learn
                • ... Lodovico Giaretta via Digitalmars-d-learn
                • ... Rufus Smith via Digitalmars-d-learn
                • ... Jonathan Marler via Digitalmars-d-learn
                • ... Lodovico Giaretta via Digitalmars-d-learn
                • ... Jonathan Marler via Digitalmars-d-learn
                • ... Lodovico Giaretta via Digitalmars-d-learn
                • ... Jonathan Marler via Digitalmars-d-learn
                • ... Lodovico Giaretta via Digitalmars-d-learn
                • ... Jonathan Marler via Digitalmars-d-learn
                • ... lqjglkqjsg via Digitalmars-d-learn

Reply via email to