Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 10 additions & 0 deletions tinyformat.h
Original file line number Diff line number Diff line change
Expand Up @@ -976,6 +976,16 @@ std::string format(const char* fmt, const Args&... args)
return oss.str();
}

/// Format list of arguments according to the given format in a string object and return
/// the result as a string.
template<typename... Args>
std::string format(const std::string& fmt, const Args&... args)
{
std::ostringstream oss;
format(oss, fmt.c_str(), args...);
return oss.str();
}

/// Format list of arguments to std::cout, according to the given format string
template<typename... Args>
void printf(const char* fmt, const Args&... args)
Expand Down