invalid_argument class — Invalid function argument
class invalid_argument : public logic_error { public: explicit invalid_argument(const string& what_arg); };
The invalid_argument
class
is thrown to report invalid arguments to functions. Specific kinds
of invalid arguments are covered by the other logic errors; use
invalid_argument
for any other
situations. For example, constructing a bitset
from a string
throws invalid_argument
if any character is other
than '0
' or '1
'.