我正在尝试检查boost :: python :: tuple中的值是否为None。我有以下代码:
pbpaste
这给了我
namespace py = boost::python;
py::list ls(inf.Module().attr("data_out"));
for (int i = 0; i < len(ls); i++){
py::tuple tuple = py::extract<py::tuple>(ls[i]);
if (tuple[1] == py::object()){ /* Does not work */
//do other stuff
}
}
有人可以帮我吗?