小编Rab*_*ter的帖子

C ++ 17 std :: from_chars和std :: to_chars的目的是什么?

在C ++ 17之前,存在多种将整数,浮点数和双精度数与字符串进行转换的方法。例如 std::stringstreamstd::to_stringstd::atoistd::stoi,和其他人可能已经被用来完成这些任务。对此,有很多文章讨论了这些方法之间的差异。

但是,C ++ 17现在引入了std::from_charsstd::to_chars。为此,我想知道引入另一种在字符串之间进行转换的方法的原因。

首先,这些新功能比以前的方法具有哪些优势和功能?

不仅如此,这种新的字符串转换方法还有明显的缺点吗?

c++ string language-lawyer c++17

10
推荐指数
2
解决办法
957
查看次数

标签 统计

c++ ×1

c++17 ×1

language-lawyer ×1

string ×1