Boost logo

Boost :

Subject: [boost] [Convert] convert<float> doesn't respect input size
From: Olaf van der Spek (ml_at_[hidden])
Date: 2017-05-15 08:48:30


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

Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk