Added debug tests for indexing, pop_back and both forms of erase. Added an improved error message for erasing a single element with end().
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@177929 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
@@ -1550,6 +1550,8 @@ vector<_Tp, _Allocator>::erase(const_iterator __position)
|
||||
"vector::erase(iterator) called with an iterator not"
|
||||
" referring to this vector");
|
||||
#endif
|
||||
_LIBCPP_ASSERT(__position != end(),
|
||||
"vector::erase(iterator) called with a non-dereferenceable iterator");
|
||||
pointer __p = const_cast<pointer>(&*__position);
|
||||
iterator __r = __make_iter(__p);
|
||||
this->__destruct_at_end(_VSTD::move(__p + 1, this->__end_, __p));
|
||||
|
Reference in New Issue
Block a user