Go back to Richel Bilderbeek's homepage.

Go back to Richel Bilderbeek's C++ page.

 

 

 

 

 

(C++) std::invalid_argument

 

An exception that is thrown due to invalid arguments.

 

In the exception hierarchy, std::invalid_argument is a derived class from std::logic_error.

 

 

 

 

 

Example

 

std::invalid_argument is thrown when the constructor of std::bitset is given a std::string that does not consist of zeroes and ones:

 

#include <bitset>

int main()
{
  std::bitset<8> byte(std::string("01234567"));
}

 

 

 

 

 

External links

 

  1. GCC reference on std::invalid_argument

 

 

 

 

 

Go back to Richel Bilderbeek's C++ page.

Go back to Richel Bilderbeek's homepage.

 

Valid XHTML 1.0 Strict