diff options
author | B. Stack <bgstack15@gmail.com> | 2022-11-22 08:54:34 -0500 |
---|---|---|
committer | B. Stack <bgstack15@gmail.com> | 2022-11-22 08:54:34 -0500 |
commit | a034cfca98d4408b175938740628a54f57eb7614 (patch) | |
tree | 501fd78c6276c0be8be8d2c671a58dd0598060b5 /zen/legacy_compiler.h | |
parent | add upstream 11.27 (diff) | |
download | FreeFileSync-a034cfca98d4408b175938740628a54f57eb7614.tar.gz FreeFileSync-a034cfca98d4408b175938740628a54f57eb7614.tar.bz2 FreeFileSync-a034cfca98d4408b175938740628a54f57eb7614.zip |
add upstream 11.2811.28
Diffstat (limited to 'zen/legacy_compiler.h')
-rw-r--r-- | zen/legacy_compiler.h | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/zen/legacy_compiler.h b/zen/legacy_compiler.h index 33394de3..8f93153e 100644 --- a/zen/legacy_compiler.h +++ b/zen/legacy_compiler.h @@ -8,6 +8,7 @@ #define LEGACY_COMPILER_H_839567308565656789 #include <version> //contains all __cpp_lib_<feature> macros +#include <string> /* C++ standard conformance: https://en.cppreference.com/w/cpp/feature_test @@ -25,6 +26,16 @@ namespace std { + + +//W(hy)TF is this not standard? https://stackoverflow.com/a/47735624 +template <class Char, class Traits, class Alloc> inline +basic_string<Char, Traits, Alloc> operator+(basic_string<Char, Traits, Alloc>&& lhs, const basic_string_view<Char> rhs) +{ return move(lhs.append(rhs.begin(), rhs.end())); } //the move *is* needed!!! + +//template <class Char> inline +//basic_string<Char> operator+(const basic_string<Char>& lhs, const basic_string_view<Char>& rhs) { return basic_string<Char>(lhs) + rhs; } +//-> somewhat inefficient: enable + optimize when needed } //--------------------------------------------------------------------------------- |