[bind10-dev] IntElement type

fujiwara at jprs.co.jp fujiwara at jprs.co.jp
Thu Jul 4 08:49:50 UTC 2013


> From: Shane Kerr <shane at isc.org>
>> However, strtoint64_t function does not exist.
>> It is assumed that "long long" and int64_t are the same sizes.
>> strtoll is used to convert string to integer.
> 
> Surely we should use boost::lexical_cast?
> 
> try {
>     int64_t value = boost::lexical_cast<int64_t>(s);
> } catch (bad_lexical_cast &) {
>     // error handling
> }
> 
> http://www.boost.org/doc/libs/1_54_0/doc/html/boost_lexical_cast.html

Thanks.

The original code used strtol and strtod.
Using C standard library in C++ is not suitable.

At ticket 2992, I wondered whether I use a lexical cast or fix the
usage of strtol.

I will change to use Boost lexical cast.

Regards,

--
Kazunori Fujiwara, JPRS <fujiwara at jprs.co.jp>


More information about the bind10-dev mailing list