摘要:
lexical_cast 字面量转换:#include <iostream>#include <boost/lexical_cast.hpp>#include <string>int main(){ int i = 0; try{ i = boost::lexical_cast<int>("100L"); //可能会抛出 bad_lexical_cast 异常 }catch(boost::bad_lexical_cast& e) { std::cout<<e.what()<<std::endl; 阅读全文