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:
Howard Hinnant
2013-03-25 22:12:26 +00:00
parent c1ca2e1e8b
commit 782da33d1c
10 changed files with 407 additions and 0 deletions

View File

@@ -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));