assert if str_format is used with no arguments

This commit is contained in:
furo 2024-09-03 08:49:55 +02:00
parent 8b5da71e89
commit 0664f12265

View file

@ -1236,6 +1236,7 @@ int str_format_int(char *buffer, size_t buffer_size, int value);
template<typename... Args>
int str_format_opt(char *buffer, int buffer_size, const char *format, Args... args)
{
static_assert(sizeof...(args) > 0, "Use str_copy instead of str_format without format arguments");
return str_format(buffer, buffer_size, format, args...);
}