Last active
December 26, 2015 07:19
-
-
Save akindyakov/7114657 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <sstream> | |
#include <string> | |
class AException { | |
public: | |
AException(const std::string& whatsWrong) | |
: name( whatsWrong ), | |
row(-1) {} | |
AException(const std::string& whatsWrong, unsigned long int _row) | |
: name( whatsWrong ), | |
row(_row) {} | |
string what()const { | |
std::stringstream errS; | |
errS << name; | |
if ( row > 0 ) { | |
errS << ". at line : " << row; | |
} | |
return errS.str(); | |
} | |
private: | |
long int row; | |
std::string name; | |
}; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment