Udostępnij za pośrednictwem


invalid_argument Class

Klasa służy jako klasa podstawowa dla wszystkich wyjątki generowane sprawozdania nieprawidłowy argument.

class invalid_argument : public logic_error {
public:
    explicit invalid_argument(const string& message);
    explicit invalid_argument(const char *message);
};

Uwagi

Wartość zwracana przez exception Class kopię komunikat.dane.

Przykład

// invalid_arg.cpp
// compile with: /EHsc /GR
#include <bitset>
#include <iostream>

using namespace std;

int main( )
{
   try 
   {
      bitset< 32 > bitset( string( "11001010101100001b100101010110000") );
   }
   catch ( exception &e ) 
   {
      cerr << "Caught " << e.what( ) << endl;
      cerr << "Type " << typeid( e ).name( ) << endl;
   };
}
  

Wymagania

Nagłówek: <stdexcept>

Obszar nazw: std

Zobacz też

Informacje

logic_error Class

Bezpieczeństwo wątków w standardowa biblioteka języka C++