From 760b846bb1d705c5127b9b364a6ae0c437ee3e96 Mon Sep 17 00:00:00 2001 From: Lubosz Sarnecki Date: Wed, 4 Sep 2024 21:51:33 +0200 Subject: [PATCH] OpenXrDisplayPlugin: Use C++20 std::format. --- plugins/openxr/src/OpenXrDisplayPlugin.cpp | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/plugins/openxr/src/OpenXrDisplayPlugin.cpp b/plugins/openxr/src/OpenXrDisplayPlugin.cpp index efd8952a7e..29843bddeb 100644 --- a/plugins/openxr/src/OpenXrDisplayPlugin.cpp +++ b/plugins/openxr/src/OpenXrDisplayPlugin.cpp @@ -16,6 +16,7 @@ #include #include #include +#include #if defined(Q_OS_WIN) #undef near @@ -133,12 +134,8 @@ static std::string glFormatStr(GLenum source) { ENUM_TO_STR(GL_RGBA16); ENUM_TO_STR(GL_RGBA16F); ENUM_TO_STR(GL_SRGB8_ALPHA8); - default: { - // TODO: Enable C++20 for std::format - std::ostringstream ss; - ss << "0x" << std::hex << source; - return ss.str(); - } + default: + return std::format("0x{:X}", source); } }