Fix compilation of soci::format() with C++20

Non literal strings can't be used with fmt::format() when using C++20,
so use fmt::vformat() instead.

This is ugly and unsafe, upcoming commits will provide a better fix, but
for now at least make the library compile in C++20 again.
This commit is contained in:
Vadim Zeitlin
2026-03-16 00:27:35 +01:00
parent 2d1dfa4107
commit d20057cdbb

View File

@@ -143,15 +143,15 @@ time_t soci::details::timegm_impl_soci ( struct tm* tb )
std::string soci::format(const char* fmt, std::string const& arg)
{
return fmt::format(fmt, arg);
return fmt::vformat(fmt, fmt::make_format_args(arg));
}
std::string soci::format(const char* fmt, int arg)
{
return fmt::format(fmt, arg);
return fmt::vformat(fmt, fmt::make_format_args(arg));
}
std::string soci::format(const char* fmt, size_t arg)
{
return fmt::format(fmt, arg);
return fmt::vformat(fmt, fmt::make_format_args(arg));
}