g*********s 发帖数: 1782 | 1 很常用也有用。每次都要写三行stringstream,觉得麻烦。 | t****t 发帖数: 6806 | 2 c++0x will have. [21.5 Numeric Conversions]
std::{ stoi, stol, stoul, stoll, stoull, stof, stod, stold }: string ->
numeric
std::{ to_string, to_wstring }: numeric -> string
the benefit of using stringstream is template friendly. if you are writing
templates, you wouldn't want a whole family of function names.
【在 g*********s 的大作中提到】 : 很常用也有用。每次都要写三行stringstream,觉得麻烦。
| e****d 发帖数: 895 | 3 You can use boost::lexical_cast.
【在 g*********s 的大作中提到】 : 很常用也有用。每次都要写三行stringstream,觉得麻烦。
| p***o 发帖数: 1252 | 4 atoi is part of the standard inherited from C90. You can find it in Table 49
of the C++98 standard.
【在 g*********s 的大作中提到】 : 很常用也有用。每次都要写三行stringstream,觉得麻烦。
|
|