]> begriffs open source - libderp/commit
Have v_remove operate on a single element
authorJoe Nelson <joe@begriffs.com>
Fri, 26 Mar 2021 02:50:55 +0000 (21:50 -0500)
committerJoe Nelson <joe@begriffs.com>
Fri, 26 Mar 2021 02:50:55 +0000 (21:50 -0500)
commitdc72f41c1f0ccee07ffd785d379d5bf9269ddb08
tree9362c1cbf62178ef0b80e9a50bd6dba28ee67f3a
parent06adaff6016c7f2da47b213035179108461e28e3
Have v_remove operate on a single element

This way it can work like a generalized pop(), and the caller
can use/free the element as desired. Removing a range has no
clean way to return the elements to the caller, other than
packaging up the results into a new vector perhaps.

Later we could add a v_erase() that works on a range and frees
the elements, like the C++ vector::erase(). Or call it v_delete()
like Vectors in Ada.
include/vector.h
src/vector.c