diff options
author | Daniel Wilhelm <daniel@wili.li> | 2016-03-16 21:34:59 +0100 |
---|---|---|
committer | Daniel Wilhelm <daniel@wili.li> | 2016-03-16 21:34:59 +0100 |
commit | 339ed7f63798fb5ccab05fa7fb9d0d95743c9c89 (patch) | |
tree | 214819f601b69bfd32507ca59047dd4d68ed5632 /zen/string_base.h | |
parent | 7.9 (diff) | |
download | FreeFileSync-339ed7f63798fb5ccab05fa7fb9d0d95743c9c89.tar.gz FreeFileSync-339ed7f63798fb5ccab05fa7fb9d0d95743c9c89.tar.bz2 FreeFileSync-339ed7f63798fb5ccab05fa7fb9d0d95743c9c89.zip |
8.0
Diffstat (limited to 'zen/string_base.h')
-rw-r--r-- | zen/string_base.h | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/zen/string_base.h b/zen/string_base.h index 96d46fc4..365e359e 100644 --- a/zen/string_base.h +++ b/zen/string_base.h @@ -266,6 +266,7 @@ public: void resize(size_t newSize, Char fillChar = 0); void swap(Zbase& other); void push_back(Char val) { operator+=(val); } //STL access + void pop_back(); Zbase& operator=(const Zbase& source); Zbase& operator=(Zbase&& tmp) noexcept; @@ -684,6 +685,16 @@ Zbase<Char, SP, AP>& Zbase<Char, SP, AP>::operator+=(Char ch) { return append(&ch, 1); } + + +template <class Char, template <class, class> class SP, class AP> inline +void Zbase<Char, SP, AP>::pop_back() +{ + const size_t len = length(); + assert(len > 0); + if (len > 0) + resize(len - 1); +} } #endif //STRING_BASE_H_083217454562342526 |