mercredi 9 novembre 2022

Nested class public method takes parent class as input

I found this in a 3rd party codebase

class Foo {
 public:
  class Log {
   public:
   static Log method(Foo& foo);
  };
};

I'm omitting many other methods from both classes for conciseness. It compiles, but it is giving me a hard time when trying to create python bindings around it via pybind11. Is this an acceptable practice or should I simply refactor the class to extract this Log class out of it?

Aucun commentaire:

Enregistrer un commentaire