diff --git a/extclass_demo.cpp b/extclass_demo.cpp index 0334e0cd..42c06922 100644 --- a/extclass_demo.cpp +++ b/extclass_demo.cpp @@ -524,6 +524,12 @@ struct StandardOps static T cmp(const T& x, const T& y) { return std::less()(x, y) ? -1 : std::less()(y, x) ? 1 : 0; } }; +// This helps us prove that we can now pass non-const reference parameters to constructors +struct Fubar { + Fubar(Foo&) {} + Fubar(int) {} +}; + /************************************************************/ /* */ /* init the module */ @@ -532,6 +538,10 @@ struct StandardOps void init_module(py::Module& m) { + py::ClassWrapper fubar(m, "Fubar"); + fubar.def(py::Constructor()); + fubar.def(py::Constructor()); + m.add(new Foo::PythonClass); m.add(new BarPythonClass); m.add(new BazPythonClass);