I'm trying to wrap a C++ class into python. I need to pass an enum value by reference through a virtual function. I'm doing it like so (non relevant code omitted):
class BasicRMLScreenWrap : public BasicRMLScreen { public: bool HandleKeyPressedDefault(const sf::Uint32 time, const ::Input::InputModule* inputModule, ::Input::PlayerInput pinput, ::Input::InputAction& iaction) { return BasicRMLScreen::HandleKeyPressed(time, inputModule, pinput, iaction); } bool HandleKeyReleased(const sf::Uint32 time, const ::Input::InputModule* inputModule, ::Input::PlayerInput pinput, ::Input::InputAction& iaction) override { return call_method<bool>(self, "HandleKeyReleased", time, ptr(inputModule), pinput, boost::ref(iaction)); } private: PyObject* self; }; class_<BasicRMLScreen, bases<GameScreen>, boost::shared_ptr<BasicRMLScreenWrap>, boost::noncopyable >("BasicRMLScreen", init<const std::string&, const std::string&, Engine*, int>()) .def("HandleKeyPressed", &BasicRMLScreen::HandleKeyPressed, &BasicRMLScreenWrap::HandleKeyPressedDefault) ; the problem is that when I wrap it like this, I get the following error: Error 74 error C2664: 'boost::mpl::assertion_failed' : cannot convert parameter 1 from 'boost::mpl::failed ************boost::mpl::or_<T1,T2>::* ***********' to 'boost::mpl::assert<false>::type' if I switch boost::ref(iaction) to iaction it compiles fine, but I need to pass it by ref for correct behaviour. I'm not sure if this is a boost::ref problem or a boost python issue but was curious if someone might have an idea how to correct it. I can pass using boost:ref fine in the other places ive used it with call_method. Is this is an issues because it's an enum? Any help would be appreciated, thanks
_______________________________________________ Cplusplus-sig mailing list Cplusplus-sig@python.org http://mail.python.org/mailman/listinfo/cplusplus-sig