in c++, has a base class for \'domain errors\', std::domain_error. i don\'t understand under what circumstances i should throw a domain error in my code. all
It refers to mathematical domains.
float MySqrRoot(float x) { // sqrt is not valid for negative numbers. if (x < 0) throw new domain_error; //... }