Мне нужно сгенерировать std::string на основе строки формата и аргументов для этой строки. Я использую C++20, и в моей текущей реализации:
#include
#include
#include
template
std::string make_str(const std::string& msg, Args &&... args) {
return std::vformat(msg, std::make_format_args((args)...));
}
int main()
{
auto msg = make_str("This is a str {} int {}", "text", 42);
std::cout
Подробнее здесь: https://stackoverflow.com/questions/793 ... -for-enums