better if you will add include stdexcept header which includes std::logic_error