Name
invalid_argument class — Invalid function argument
Synopsis
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
‘.
See Also
Get C++ In a Nutshell now with the O’Reilly learning platform.
O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.