Let's say that when initializing a pet class, I wanted to exclude or disallow dogs or cats as species. What would be the proper way to throw an invalid_argument exception?
using std::string;
#include <stdexcept>
using std:: invalid_argument;
struct Pet {
const string name;
long age = 0;
const string species;
Pet() : name("Dan"), age(0), species("alligator"){}
Pet(const string & the_name, const string & the_species): name(the_name),
species(the_species), age(0) {};
};