refactor: Introduce struct to hold a runtime format string

This brings the format types closer to the standard library types:

* FormatStringCheck corresponds to std::basic_format_string, with
  compile-time checks done via ConstevalFormatString
* RuntimeFormat corresponds to std::runtime_format, with no compile-time
  checks done.

Also, it documents where no compile-time checks are done.
This commit is contained in:
MarcoFalke
2024-12-07 11:49:48 +01:00
parent fa6adb0134
commit fa3efb5729
5 changed files with 33 additions and 20 deletions

View File

@@ -16,7 +16,7 @@ template <unsigned NumArgs>
void TfmFormatZeroes(const std::string& fmt)
{
std::apply([&](auto... args) {
(void)tfm::format(fmt, args...);
(void)tfm::format(tfm::RuntimeFormat{fmt}, args...);
}, std::array<int, NumArgs>{});
}