Quantcast

[Convert] convert<float> doesn't respect input size

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

[Convert] convert<float> doesn't respect input size

Boost - Dev mailing list
Hi,

const char* a = "42";
boost::string_ref b(a, 1);
float c = boost::convert<float>(b, boost::cnv::strtol(), -1); // returns 42
assert(c == 4);

https://github.com/boostorg/convert/issues/29

--
Olaf

_______________________________________________
Unsubscribe & other changes: http://lists.boost.org/mailman/listinfo.cgi/boost
Loading...