robotpy / robotpy-build

(mostly) automated C++ wrapping for Python
BSD 3-Clause "New" or "Revised" License
37 stars 16 forks source link

Structure code so that `using Base::fn` can automatically bind from the base class #236

Open virtuald opened 1 week ago

virtuald commented 1 week ago

So if you have:

class Foo : public Bar {
public:
    using Bar::fn;

   void fn(whatever w); 
};

Currently robotpy-build (a) doesn't know its a function and (b) fn is present in Foo, but only the overloads that are in Foo, not the ones that are in Bar.

I could imagine that we could setup functions that the base class makes available (maybe in its trampoline?) where the original base class .def statements are called, but they get added to the child class instead.

This would probably be annoying to set up, I'm not sure it's worth it.