You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I have a little problem I haven't quite figured out what to do. I think it is definitely possible with py::list and doing tests and casts on individual elements the the c++ side, but I am trying to think of a better way than that.
The c++ api takes an argument of "custom_class_pointers[]", where some of the values are allowed to be nulls. And I am hoping to be able to pass [None, custom_class_instance], or something close to it, from the python side. I have tried using a lamba taking "std::vector<custom_class>" and "std::vector<std::optional<custom_class>>" (c++17 is allowed in my project). But neither seems to let me put a None in the list.
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
Hi,
I have a little problem I haven't quite figured out what to do. I think it is definitely possible with py::list and doing tests and casts on individual elements the the c++ side, but I am trying to think of a better way than that.
The c++ api takes an argument of "custom_class_pointers[]", where some of the values are allowed to be nulls. And I am hoping to be able to pass [None, custom_class_instance], or something close to it, from the python side. I have tried using a lamba taking "std::vector<custom_class>" and "std::vector<std::optional<custom_class>>" (c++17 is allowed in my project). But neither seems to let me put a None in the list.
TIA
Beta Was this translation helpful? Give feedback.
All reactions