Is it possible that boost::lexical_cast<std::string>(Int_Type)
throw? The only time I can think of where there will be no mem for string but can there be any other, more reasonable choices?
According to the documentation, lexical_cast
can throw bad_lexical_cast
. On top of that, as you already mentioned, there may be dynamic allocation, which can always cause a bad_alloc
exception.
Edit: As for the particular situation lexical_cast<std::string, int>
, it seems unlikely that any part along the chain could fail other than by allocation error, but the documentation doesn't (to my knowledge) guarantee that there won't be a "bad cast" exception.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With