forked from OSchip/llvm-project
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:
parent
d24be45d99
commit
6c425556f2
|
@ -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;
|
||||
|
|
Loading…
Reference in New Issue