[prev in list] [next in list] [prev in thread] [next in thread]
List: boost
Subject: [boost] How to specify return policy for object returned as part of
From: "Eddie C." <cao.yiqun+boost () gmail ! com>
Date: 2011-01-31 22:54:11
Message-ID: AANLkTimpZRCTJdENjE0wtjL9XN51fb+jTv-3oqW2H8P- () mail ! gmail ! com
[Download RAW message or body]
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
boost::python::return_value_policy<boost::python::manage_new_object>.
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&
description)
{
...
return boost::python::make_tuple(myObject, errmsg);
}
How should I specify the return policy with this change?
Thanks,
Eddie
_______________________________________________
Unsubscribe & other changes: http://lists.boost.org/mailman/listinfo.cgi/boost
[prev in list] [next in list] [prev in thread] [next in thread]
Configure |
About |
News |
Add a list |
Sponsored by KoreLogic