summaryrefslogtreecommitdiffhomepage
path: root/compat/string-literal-operator.hpp
diff options
context:
space:
mode:
authorStanislaw Halik <sthalik@misaki.pl>2018-01-03 13:58:30 +0100
committerStanislaw Halik <sthalik@misaki.pl>2018-01-03 14:35:55 +0100
commitcbaafb9a828f13abb55b99f8f2c4caa2337ef9e9 (patch)
tree24ca91194b7f66b6caff05b146249d75512d87d7 /compat/string-literal-operator.hpp
parentc248b83845e0ad07de6e2e9b433b161a87197b38 (diff)
compat/util: add string literal operator
It's unused, but useful for embedded .text section literals with unlimited lifetime.
Diffstat (limited to 'compat/string-literal-operator.hpp')
-rw-r--r--compat/string-literal-operator.hpp9
1 files changed, 9 insertions, 0 deletions
diff --git a/compat/string-literal-operator.hpp b/compat/string-literal-operator.hpp
new file mode 100644
index 00000000..3ea4eb11
--- /dev/null
+++ b/compat/string-literal-operator.hpp
@@ -0,0 +1,9 @@
+#pragma once
+
+#include <QLatin1String>
+#include <cstddef>
+
+static inline constexpr auto operator"" _qstr(const char* str, std::size_t N)
+{
+ return QLatin1String(str, str + N);
+}