throw a std:invalid_argument exception