Utils: Use _cpp_lib_constexpr_string to test for constexpr std::string

Seems not all compiler already implemented constexpr std::string.

Change-Id: I588ef56767125a38fd80d0798ea954c11c8f6237
Reviewed-by: Qt CI Patch Build Bot <ci_patchbuild_bot@qt.io>
Reviewed-by: hjk <hjk@qt.io>
This commit is contained in:
Marco Bubke
2023-06-30 11:18:53 +02:00
parent d2425f6e12
commit c572855b95

View File

@@ -12,6 +12,12 @@
#include <string>
#include <string_view>
#if __cpp_lib_constexpr_string >= 201907L
#define constexpr_string constexpr
#else
#define constexpr_string
#endif
namespace Utils {
template <typename String>
@@ -63,7 +69,7 @@ public:
return SmallStringView(data() + position, length);
}
constexpr20 operator std::string() const { return std::string(data(), size()); }
constexpr_string operator std::string() const { return std::string(data(), size()); }
explicit operator QString() const
{