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 1e7dff35a6
commit 5a1d7ab054

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;