summaryrefslogtreecommitdiff
path: root/cpp/src/slice2java/Gen.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'cpp/src/slice2java/Gen.cpp')
-rw-r--r--cpp/src/slice2java/Gen.cpp12
1 files changed, 7 insertions, 5 deletions
diff --git a/cpp/src/slice2java/Gen.cpp b/cpp/src/slice2java/Gen.cpp
index 004987f7310..90ee4cae3f6 100644
--- a/cpp/src/slice2java/Gen.cpp
+++ b/cpp/src/slice2java/Gen.cpp
@@ -2536,11 +2536,13 @@ Slice::Gen::TypesVisitor::visitConst(const ConstPtr& p)
default:
{
unsigned char uc = *c;
- out << "\\u";
- out.flags(ios_base::hex);
- out.width(4);
- out.fill('0');
- out << static_cast<unsigned>(uc);
+ ostringstream s;
+ s << "\\u";
+ s.flags(ios_base::hex);
+ s.width(4);
+ s.fill('0');
+ s << static_cast<unsigned>(uc);
+ out << s.str();
break;
}
}