From cbaafb9a828f13abb55b99f8f2c4caa2337ef9e9 Mon Sep 17 00:00:00 2001 From: Stanislaw Halik Date: Wed, 3 Jan 2018 13:58:30 +0100 Subject: compat/util: add string literal operator It's unused, but useful for embedded .text section literals with unlimited lifetime. --- compat/string-literal-operator.hpp | 9 +++++++++ compat/util.hpp | 1 + 2 files changed, 10 insertions(+) create mode 100644 compat/string-literal-operator.hpp (limited to 'compat') 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 +#include + +static inline constexpr auto operator"" _qstr(const char* str, std::size_t N) +{ + return QLatin1String(str, str + N); +} diff --git a/compat/util.hpp b/compat/util.hpp index a1976e35..f679afcf 100644 --- a/compat/util.hpp +++ b/compat/util.hpp @@ -3,6 +3,7 @@ #include "opentrack-library-path.h" #include "ndebug-guard.hpp" #include "run-in-thread.hpp" +#include "string-literal-operator.hpp" #include "meta.hpp" #include "functional.hpp" #include "macros.hpp" -- cgit v1.2.3