diff --git a/core/print.hh b/core/print.hh index 86f018d293..1fce216c34 100644 --- a/core/print.hh +++ b/core/print.hh @@ -45,4 +45,12 @@ print(const char* fmt, A&&... a) { return print(bfmt, std::forward(a)...); } +template +std::string +sprint(const char* fmt, A&&... a) { + boost::format bfmt(fmt); + apply_format(bfmt, std::forward(a)...); + return bfmt.str(); +} + #endif /* PRINT_HH_ */