提交 6739797d 编写于 作者: M minqiyang

Add empty template for Sprintf

上级 adfaf9a6
...@@ -84,7 +84,16 @@ void Fprintf(std::ostream& out, const char* fmt, const Args&... args) { ...@@ -84,7 +84,16 @@ void Fprintf(std::ostream& out, const char* fmt, const Args&... args) {
} }
template <typename... Args> template <typename... Args>
std::string Sprintf(const char* fmt = "", const Args&... args) { std::string Sprintf(const Args&... args) {
if (0u == sizeof...(args)) {
Sprintf("", args);
}
return Sprintf(args, args);
}
template <typename... Args>
std::string Sprintf(const char* fmt, const Args&... args) {
std::ostringstream oss; std::ostringstream oss;
Fprintf(oss, fmt, args...); Fprintf(oss, fmt, args...);
return oss.str(); return oss.str();
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册