range_error – třída
Třída slouží jako základní třída pro všechny výjimky vyvolána rozsah chybové zprávě.
class range_error : public runtime_error {
public:
explicit range_error(const string& message);
explicit range_error(const char *message);
};
Poznámky
Hodnotu vrácenou exception – třída je kopie zpráva.dat.
Příklad
// range_error.cpp
// compile with: /EHsc /GR
#include <iostream>
using namespace std;
int main()
{
try
{
throw range_error( "The range is in error!" );
}
catch (exception &e)
{
cerr << "Caught: " << e.what( ) << endl;
cerr << "Type: " << typeid( e ).name( ) << endl;
};
}
Požadavky
Záhlaví: <stdexcept>
Obor názvů: std