thiru-mg commented on code in PR #3277:
URL: https://github.com/apache/avro/pull/3277#discussion_r1900689277
##########
lang/c++/impl/json/JsonIO.hh:
##########
@@ -405,19 +404,17 @@ public:
template<typename T>
void encodeNumber(T t) {
sep();
- std::ostringstream oss;
- oss << boost::lexical_cast<std::string>(t);
- const std::string s = oss.str();
+ const std::string s = std::to_string(t);
out_.writeBytes(reinterpret_cast<const uint8_t *>(s.data()), s.size());
sep2();
}
void encodeNumber(double t) {
sep();
std::ostringstream oss;
- if (boost::math::isfinite(t)) {
- oss << boost::lexical_cast<std::string>(t);
- } else if (boost::math::isnan(t)) {
+ if (std::isfinite(t)) {
+ oss << t;
Review Comment:
It appears the `lexical_cast` also has the same locale based behavior. Given
that there is no clean solution for C++14, and `to_string` is no worse than
`lexical_cast` should we proceed with this PR? I'll merge this PR if no
objection is forthcoming for a day or two.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]