diff options
Diffstat (limited to 'include/o3tl/sorted_vector.hxx')
-rw-r--r-- | include/o3tl/sorted_vector.hxx | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/include/o3tl/sorted_vector.hxx b/include/o3tl/sorted_vector.hxx index 6e245353fe70..8324e333198a 100644 --- a/include/o3tl/sorted_vector.hxx +++ b/include/o3tl/sorted_vector.hxx @@ -97,6 +97,17 @@ public: m_vector.begin() + (last - m_vector.begin())); } + /** + * make erase return the removed element, otherwise there is no useful way of extracting a std::unique_ptr + * from this. + */ + Value erase_extract( size_t index ) + { + Value val = std::move(m_vector[index]); + m_vector.erase(m_vector.begin() + index); + return val; + } + void clear() { m_vector.clear(); |