Skip to content

Commit

Permalink
add std::format specialization for REL::Version
Browse files Browse the repository at this point in the history
  • Loading branch information
shad0wshayd3 committed Sep 7, 2024
1 parent 7292da8 commit a18e9fd
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 a18e9fd

Please sign in to comment.