From 5ca3d00e262baac7cfad939d7155d9f0122d949f Mon Sep 17 00:00:00 2001 From: Victor Zverovich Date: Thu, 25 Sep 2014 12:15:16 -0700 Subject: [PATCH] Mind the lifetime --- format.h | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/format.h b/format.h index 580a7966..1a3b83f1 100644 --- a/format.h +++ b/format.h @@ -1990,7 +1990,8 @@ void format(BasicFormatter &f, const Char *&format_str, const T &value) { os << value; internal::Arg arg; internal::Value &arg_value = arg; - arg_value = internal::MakeValue(os.str()); + std::basic_string str = os.str(); + arg_value = internal::MakeValue(str); arg.type = internal::Arg::STRING; format_str = f.format(format_str, arg); }