gpt4 book ai didi

c++ - lexical_cast int 到字符串

转载 作者:IT老高 更新时间:2023-10-28 21:42:30 27 4
gpt4 key购买 nike

忽略 boost::lexical_cast 的异常是否安全?将 int 转换为 std::string 时?

最佳答案

int 转换为 std::string 时词法转换引发的异常与转换无关,但与资源不可用有关。因此,您可以像忽略 operator new 引发的异常 bad_alloc 一样忽略它。

关于c++ - lexical_cast int 到字符串,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/2736060/

27 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com