[C++-sig] manage_new_object on vector items?
Håkon Groven
hgroven at emgs.com
Mon Aug 13 11:14:27 CEST 2007
Hi!
I have the following two functions:
.h:
std::vector<channel_group*> get_available_ch_groups() const;
channel_group* get_channel_group(channel_group_type gr_type) const;
wrapper-code:
.def("get_available_ch_groups", &survey_result::get_available_ch_groups
.def("get_channel_group", &survey_result::get_channel_group,
return_value_policy<manage_new_object>())
The items returned in the vector are not garbage collected, while the
object pointed to by get_channel_group's return is.
Is it possible to use something like "manage_new_object" on the items in
the vector returned from get_available_ch_groups?
If this is not possible, is shared_ptr the way to go?
I'd be glad if anyone could help!
Haakon.
More information about the Cplusplus-sig
mailing list