mirror of
https://github.com/pybind/pybind11.git
synced 2026-06-07 00:04:42 +00:00
stl_bind: add binding for std::vector::clear (#2074)
This commit is contained in:
@@ -136,6 +136,13 @@ void vector_modifiers(enable_if_t<is_copy_constructible<typename Vector::value_t
|
||||
return v.release();
|
||||
}));
|
||||
|
||||
cl.def("clear",
|
||||
[](Vector &v) {
|
||||
v.clear();
|
||||
},
|
||||
"Clear the contents"
|
||||
);
|
||||
|
||||
cl.def("extend",
|
||||
[](Vector &v, const Vector &src) {
|
||||
v.insert(v.end(), src.begin(), src.end());
|
||||
|
||||
Reference in New Issue
Block a user