summaryrefslogtreecommitdiff
path: root/zen/legacy_compiler.h
diff options
context:
space:
mode:
authorB. Stack <bgstack15@gmail.com>2022-11-22 08:54:34 -0500
committerB. Stack <bgstack15@gmail.com>2022-11-22 08:54:34 -0500
commita034cfca98d4408b175938740628a54f57eb7614 (patch)
tree501fd78c6276c0be8be8d2c671a58dd0598060b5 /zen/legacy_compiler.h
parentadd upstream 11.27 (diff)
downloadFreeFileSync-11.28.tar.gz
FreeFileSync-11.28.tar.bz2
FreeFileSync-11.28.zip
add upstream 11.2811.28
Diffstat (limited to 'zen/legacy_compiler.h')
-rw-r--r--zen/legacy_compiler.h11
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
}
//---------------------------------------------------------------------------------
bgstack15