it's going to be better if you will add include stdexcept header which includes std::logic_error