If I just simply use throw some_string; then I get terminate called after throwing an instance of 'std::string'. How can I get some printout with the string value actually shown, for example, terminate called after throwing 'This is wrong', or something similar?
Thank you.
Generally, you should be throwing subclasses of
std::exception.Most C++ implementations automatically print out the result of callingexception::what()if the exception is uncaught.With GCC, this outputs: