From 3e609bab04d0484937f7fc45086134e79b92fce3 Mon Sep 17 00:00:00 2001 From: Patrick Pelissier Date: Wed, 14 Mar 2018 23:46:30 +0100 Subject: [PATCH] Add method pop_until --- m-array.h | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/m-array.h b/m-array.h index 8cb6b67e..f99ac133 100644 --- a/m-array.h +++ b/m-array.h @@ -378,6 +378,14 @@ ARRAYI_CONTRACT(v); \ } \ \ + static inline void \ + M_C(name, _pop_until)(array_t v, array_it_t pos) \ + { \ + ARRAYI_CONTRACT(v); \ + assert (v == pos->array); \ + v->size = pos->index; \ + } \ + \ static inline bool \ M_C(name, _empty_p)(const array_t v) \ { \