From a18e9fd24d17bd35b5e2f1db4c5c22a43b5477a1 Mon Sep 17 00:00:00 2001 From: shad0wshayd3 Date: Fri, 6 Sep 2024 22:13:58 -0600 Subject: [PATCH] add std::format specialization for REL::Version --- include/REL/Version.h | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/include/REL/Version.h b/include/REL/Version.h index 31fb4a29f..c5b396812 100644 --- a/include/REL/Version.h +++ b/include/REL/Version.h @@ -87,3 +87,15 @@ namespace REL [[nodiscard]] std::optional GetFileVersion(stl::zwstring a_filename); } + +#ifdef __cpp_lib_format +template +struct std::formatter : formatter +{ + template + constexpr auto format(const REL::Version a_version, FormatContext& a_ctx) const + { + return formatter::format(a_version.string(), a_ctx); + } +}; +#endif