3
是boost::lexical_cast<bool, std::string>(string);
唯一的选择或有更快的方法来做这样的事情,它会工作在True
字符串,它将工作在1
字符串,它会工作在TRUE
字符串?Boost:如何将字符串“true”或“1”转换为bool true,“0”或“false”是否为bool false?
(因为对我来说它给bad lexical cast: source type value could not be interpreted as target
错误)
更快?你与之比较的速度有多慢? – Gabe
主要是我不知道它是否会在这样的字符串上工作? – Rella
你的性能瓶颈究竟是什么? –