Boost logo

Boost :

Subject: [boost] How to specify return policy for object returned as part of a tuple in boost python
From: Eddie C. (cao.yiqun+boost_at_[hidden])
Date: 2011-01-31 17:54:11

Hi all,

I have a function that creates a C++ object. Before the refactor, I was
returning a pointer from the C++ function, and in the boost python
wrapper declaration, I would use

Now I need to return not only just the object, but also some error
messages, and the refactor basically changes the C++ function to let
it return a tuple:

boost::python::tuple create_object_from_description(std::string&
  return boost::python::make_tuple(myObject, errmsg);

How should I specify the return policy with this change?


Boost list run by bdawes at, gregod at, cpdaniel at, john at