Skip to content

Looking for an example to bind std::deque, Thanks! #4292

Answered by Skylion007
ffyu-lj asked this question in Q&A
Discussion options

You must be logged in to vote

Assuming you have a caster made for sampel SampleType, you should include pybind/stl.h and that will give you a std::deque caster automatically. Alternatively, std::deque<std::pair<int,std::string>> should work out of the box as a non-opaque caster.

We don't have any casters for std::deque written in stl_bind.h. STL bind_vector and bind_map are the only two implement in stl_bind.h. Otherwise, you would need to bind all the methods yourself manually.

Replies: 3 comments 2 replies

Comment options

You must be logged in to vote
0 replies
Answer selected by ffyu-lj
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
2 replies
@ffyu-lj
Comment options

@ffyu-lj
Comment options

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants