summaryrefslogtreecommitdiff
path: root/zen/string_base.h
diff options
context:
space:
mode:
Diffstat (limited to 'zen/string_base.h')
-rw-r--r--zen/string_base.h11
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
bgstack15