I'm playing with the great fmt C++ library to format strings more gracefully.
And I'd like to pass a non-variable arguments list to fmt::format
. It could be a std::vector
, or std::string
, or whatever, but it will always match the format string.
So fmt::format
works like:
std::string message = fmt::format("The answer is {} so don't {}", "42", "PANIC!");
But what I'd like is something like:
std::vector<std::string> arr;
arr.push_back("42");
arr.push_back("PANIC!");
std::string message = fmt::format("The answer is {} so don't {}", arr);
Is there a way / workaround to do so?