summaryrefslogtreecommitdiff
path: root/zen/string_base.h
diff options
context:
space:
mode:
authorB Stack <bgstack15@gmail.com>2020-03-18 14:13:41 -0400
committerB Stack <bgstack15@gmail.com>2020-03-18 14:13:41 -0400
commit37d3442dc789d22fa802c9513c7fefbd2614b3a2 (patch)
treea43b1c04f9947fe02d7d5444354f0176c28ed594 /zen/string_base.h
parentadd upstream 10.21 (diff)
downloadFreeFileSync-37d3442dc789d22fa802c9513c7fefbd2614b3a2.tar.gz
FreeFileSync-37d3442dc789d22fa802c9513c7fefbd2614b3a2.tar.bz2
FreeFileSync-37d3442dc789d22fa802c9513c7fefbd2614b3a2.zip
add upstream 10.22
Diffstat (limited to 'zen/string_base.h')
-rw-r--r--zen/string_base.h7
1 files changed, 4 insertions, 3 deletions
diff --git a/zen/string_base.h b/zen/string_base.h
index d2e00baf..42e1bdf3 100644
--- a/zen/string_base.h
+++ b/zen/string_base.h
@@ -328,11 +328,11 @@ template <class Char, template <class> class SP> inline Zbase<Char, SP> operator
template <class Char, template <class> class SP> inline Zbase<Char, SP> operator+(Zbase<Char, SP>&& lhs, const Char* rhs) { return std::move(lhs += rhs); } //lhs, is an l-value parameter...
template <class Char, template <class> class SP> inline Zbase<Char, SP> operator+(Zbase<Char, SP>&& lhs, Char rhs) { return std::move(lhs += rhs); } //and not a local variable => no copy elision
-template <class Char, template <class> class SP> inline Zbase<Char, SP> operator+( Char lhs, const Zbase<Char, SP>& rhs) { return Zbase<Char, SP>(&lhs, 1) += rhs; }
template <class Char, template <class> class SP> inline Zbase<Char, SP> operator+(const Char* lhs, const Zbase<Char, SP>& rhs) { return Zbase<Char, SP>(lhs ) += rhs; }
+template <class Char, template <class> class SP> inline Zbase<Char, SP> operator+( Char lhs, const Zbase<Char, SP>& rhs) { return Zbase<Char, SP>(&lhs, 1) += rhs; }
-
-
+template <class Char, template <class> class SP> inline Zbase<Char, SP> operator+(const Zbase<Char, SP>&, int) = delete; //detect usage errors
+template <class Char, template <class> class SP> inline Zbase<Char, SP> operator+(int, const Zbase<Char, SP>&) = delete; //
@@ -567,6 +567,7 @@ template <class Char, template <class> class SP> inline
Char& Zbase<Char, SP>::operator[](size_t pos)
{
assert(pos < length()); //design by contract! no runtime check!
+ reserve(length()); //make unshared!
return rawStr_[pos];
}
bgstack15