Skip to content

Commit

Permalink
Merge pull request #132 from shad0wshayd3-TES5/std-format-version
Browse files Browse the repository at this point in the history
add std::format specialization for REL::Version
  • Loading branch information
powerof3 authored Sep 7, 2024
2 parents 7292da8 + a18e9fd commit 8a38010
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions include/REL/Version.h
Original file line number Diff line number Diff line change
Expand Up @@ -87,3 +87,15 @@ namespace REL

[[nodiscard]] std::optional<Version> GetFileVersion(stl::zwstring a_filename);
}

#ifdef __cpp_lib_format
template <class CharT>
struct std::formatter<REL::Version, CharT> : formatter<std::string, CharT>
{
template <class FormatContext>
constexpr auto format(const REL::Version a_version, FormatContext& a_ctx) const
{
return formatter<std::string, CharT>::format(a_version.string(), a_ctx);
}
};
#endif

0 comments on commit 8a38010

Please sign in to comment.