add a new pop_back_val method which returns the value popped. This is

heretical from a STL standpoint, but is oh-so-useful for things that 
can't throw exceptions when copied, like, well, everything in LLVM.

llvm-svn: 60587
This commit is contained in:
Chris Lattner 2008-12-05 07:11:05 +00:00
parent d24be45d99
commit 6c425556f2
1 changed files with 6 additions and 0 deletions

View File

@ -162,6 +162,12 @@ public:
End->~T();
}
T pop_back_val() {
T Result = back();
pop_back();
return Result;
}
void clear() {
destroy_range(Begin, End);
End = Begin;