mirror of
https://github.com/allankoechke/soci.git
synced 2026-11-30 10:58:24 +00:00
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:
@@ -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));
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user