$include_dir="/home/hyper-archives/boost/include"; include("$include_dir/msg-header.inc") ?>
Subject: Re: [boost] lexical_cast optimization
From: Othman, Ossama (ossama.othman_at_[hidden])
Date: 2008-12-03 14:11:11
Hi,
>Please do not proceed at the expense of error handling. I believe using
>itoa
>and ftoa is fine, but using atoi and atof is definitely not:
>
> cout << atoi("123X") prints 123
> cout << atoi("X") prints 0
>
>lexical_cast<int> throws in both cases, which I think is 100% the correct
>behaviour.
Would strtol() and friends be suitable from a performance point of view? They at least provide some error reporting.
-Ossama