lexical_cast int to string

前端 未结 3 1541
耶瑟儿~
耶瑟儿~ 2021-02-19 16:22

Is it safe to ignore exception of boost::lexical_cast when converting int to std::string?

3条回答
  •  醉酒成梦
    2021-02-19 17:15

    Exception raised by lexical cast when converting an int to std::string are not associated to the conversion, but to resource unavailable. So you can ignore this in the same way you ignore the exception bad_alloc raised by operator new.

提交回复
热议问题