2
任何人都可以讓我知道如何拋出bad_lexical_cast異常。如何拋出提升不好的詞法拋出異常
單元測試嘲諷我有以下代碼:
if(!Throw)
return boost::lexical_cast<std::string>(some_value);
else
throw boost::throw_exception(boost::bad_lexical_cast());
但這如下給人一種編譯錯誤:
error: invalid use of ‘void’ throw boost::throw_exception(boost::bad_lexical_cast());