-
Dear My question is about wrapping a method returning a vector of pointer. The pointers are owned by the To illustrate the point, I have something like: struct Element;
struct ElementsManager{
std::vector<Element *> select(std::string view);
private:
std::vector<std::unique_ptr<Element>> elements;
}; How can I wrap the Thanks for any help. |
Beta Was this translation helpful? Give feedback.
Answered by
wjakob
Oct 2, 2023
Replies: 1 comment 2 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
I would say: use the normal
std::vector
type caster, but bind the method with a return value policy ofreference_internal
.(You'll want to read up on RVPs in the documentation if this doesn't make sense)