From 91c5602d662a91a9f2e5a730459fccea35080fd6 Mon Sep 17 00:00:00 2001 From: minqiyang Date: Tue, 3 Jul 2018 13:47:25 +0800 Subject: [PATCH] Add template specialization back --- paddle/fluid/string/printf.h | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/paddle/fluid/string/printf.h b/paddle/fluid/string/printf.h index 062095a1c3e..47de2337739 100644 --- a/paddle/fluid/string/printf.h +++ b/paddle/fluid/string/printf.h @@ -83,6 +83,13 @@ void Fprintf(std::ostream& out, const char* fmt, const Args&... args) { tinyformat::vformat(out, fmt, tinyformat::makeFormatList(args...)); } +template +std::string Sprintf(const Args&... args) { + std::ostringstream oss; + Fprintf(oss, ""); + return oss.str(); +} + template std::string Sprintf(const char* fmt, const Args&... args) { std::ostringstream oss; -- GitLab