From 9b661d3e548dfd20218f6e1c45b053c29bc6d6c8 Mon Sep 17 00:00:00 2001 From: tqcq <99722391+tqcq@users.noreply.github.com> Date: Fri, 12 Jan 2024 12:41:17 +0800 Subject: [PATCH] fix replace to_string by stringstream --- src/ulib/status.cpp | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/src/ulib/status.cpp b/src/ulib/status.cpp index af1022c..f2d1444 100644 --- a/src/ulib/status.cpp +++ b/src/ulib/status.cpp @@ -66,9 +66,11 @@ StatusCodeToString(StatusCode code) return "UNAVAILABLE"; case StatusCode::kDataLoss: return "DATA_LOSS"; - default: - return "UNEXPECTED_STATUS_CODE=" - + std::to_string(static_cast(code)); + default: { + std::stringstream ss; + ss << "UNEXPECTED_STATUS_CODE=" << static_cast(code); + return ss.str(); + } } }