KalleOlaviNiemitalo commented on code in PR #3277:
URL: https://github.com/apache/avro/pull/3277#discussion_r1900117522


##########
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 looks like the `std::to_chars` functions that take an `std::chars_format` 
parameter are available in GCC 11 
([changes](https://gcc.gnu.org/gcc-11/changes.html)) but the ARM CI has 9.4.0.
   
   `oss.imbue(std::locale::classic())` then?  Does Avro have tests in which the 
C++ global locale is not classic?



-- 
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]

Reply via email to