Codechange: Add format_append as short-hand to format_to + back_inserter.

This commit is contained in:
frosch
2025-04-29 12:37:34 +02:00
committed by frosch
parent 98481ecc01
commit fda93b6f35
12 changed files with 32 additions and 27 deletions
+6
View File
@@ -45,4 +45,10 @@ struct fmt::formatter<T, Char> : fmt::formatter<typename T::BaseType> {
}
};
template <class... Args>
void format_append(std::string &out, fmt::format_string<Args...> &&fmt, Args&&... args)
{
fmt::format_to(std::back_inserter(out), std::forward<decltype(fmt)>(fmt), std::forward<decltype(args)>(args)...);
}
#endif /* FORMAT_HPP */