I need to build a Twine with a double value, so I was using std::to_string, but I’m getting “error: ‘to_string’ is not a member of ‘std’” from a windows buildbot. What’s the canonical way to create a Twine() out of a double?
Thanks.
I need to build a Twine with a double value, so I was using std::to_string, but I’m getting “error: ‘to_string’ is not a member of ‘std’” from a windows buildbot. What’s the canonical way to create a Twine() out of a double?
Thanks.
via raw_ostream. Create a new raw_string_ostream or
raw_svector_ostream, << the double into it and take the string. I
don't think we have a more convenient way for that currently and
to_string is still not universally available.
- Ben
Thanks. I
OS << format("%.2f", foo), takes a printf format string.
- Ben
Thanks! That worked just fine.