labath added a comment.

Hmm... I like your solution of the typemap problem, but this CRTP class seems 
to be way more complicated than needed. There shouldn't be any need for CRTP as 
we already have regular dynamic dispatch via virtual methods. Also, I don't 
think the forwarding should be needed if you're going the template route. How 
about something like this instead?

  template<typename Base>
  class OwningPythonFile : public Base {
    Status Close() { /* close magic here*/; }
    // no need to forward anything -- inheritance handles that
  };
  
  class TextPythonFile: public OwningPythonFile<File> {
    // override methods as usual
  };
  // same for BinaryPythonFile

Then depending on what you need, you create either a NativeFile, 
OwningPythonFile<NativeFile>, or a Text/BinaryPythonFile. How does that sound?


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D68188/new/

https://reviews.llvm.org/D68188



_______________________________________________
lldb-commits mailing list
lldb-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits

Reply via email to