diff options
author | Daniel Wilhelm <shieldwed@outlook.com> | 2020-03-20 22:40:40 +0000 |
---|---|---|
committer | Daniel Wilhelm <shieldwed@outlook.com> | 2020-03-20 22:40:40 +0000 |
commit | 7a3869712e5c23b8e5e17ece4cbbf3d5909de5a6 (patch) | |
tree | a43b1c04f9947fe02d7d5444354f0176c28ed594 /zen/string_base.h | |
parent | Merge branch '10.21' into 'master' (diff) | |
parent | add upstream 10.22 (diff) | |
download | FreeFileSync-7a3869712e5c23b8e5e17ece4cbbf3d5909de5a6.tar.gz FreeFileSync-7a3869712e5c23b8e5e17ece4cbbf3d5909de5a6.tar.bz2 FreeFileSync-7a3869712e5c23b8e5e17ece4cbbf3d5909de5a6.zip |
Merge branch '10.22' into 'master'10.22
add upstream 10.22
See merge request opensource-tracking/FreeFileSync!19
Diffstat (limited to 'zen/string_base.h')
-rw-r--r-- | zen/string_base.h | 7 |
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]; } |