I am defining a pybind11 method that takes an object argument type (because it can take a variety of different argument types). I want to check if that object is an integer, and if so get that integer. How do I do this?
In other words, what is the pybind11 equivalent of this python code:
def method(obj):
if isinstance(obj, int):
value = int(obj)
...
else:
...
void method(const pybind11::object &obj) {
...
}