mardi 24 mars 2015

How can we throw an expcetion with a message?

I need to throw an exception and print some helpful message. I tried this:



throw std::exception("message");
throw std::exception(std::string("message"));


untill I found that std::exception had only two constructors:



exception();
exception( const exception& other );


So what is the good way?


Aucun commentaire:

Enregistrer un commentaire