📄 stdexcept
字号:
// stdexcept standard header
#pragma once
#ifndef _STDEXCEPT_
#define _STDEXCEPT_
#ifndef RC_INVOKED
#include <exception>
#include <xstring>
#pragma pack(push,_CRT_PACKING)
#pragma warning(push,3)
_STD_BEGIN
#ifndef _Mbstinit
#define _Mbstinit(x) _Mbstatet x = {0}
#endif /* _Mbstinit */
// CLASS logic_error
class logic_error
: public exception
{ // base of all logic-error exceptions
public:
typedef exception _Mybase;
explicit logic_error(const string& _Message)
: _Mybase(_Message.c_str())
{ // construct from message string
}
explicit logic_error(const char *_Message)
: _Mybase(_Message)
{ // construct from message string
}
#if _HAS_EXCEPTIONS
#else /* _HAS_EXCEPTIONS */
protected:
virtual void _Doraise() const
{ // perform class-specific exception handling
_RAISE(*this);
}
#endif /* _HAS_EXCEPTIONS */
};
// CLASS domain_error
class domain_error
: public logic_error
{ // base of all domain-error exceptions
public:
typedef logic_error _Mybase;
explicit domain_error(const string& _Message)
: _Mybase(_Message.c_str())
{ // construct from message string
}
explicit domain_error(const char *_Message)
: _Mybase(_Message)
{ // construct from message string
}
#if _HAS_EXCEPTIONS
#else /* _HAS_EXCEPTIONS */
protected:
virtual void _Doraise() const
{ // perform class-specific exception handling
_RAISE(*this);
}
#endif /* _HAS_EXCEPTIONS */
};
// CLASS invalid_argument
class invalid_argument
: public logic_error
{ // base of all invalid-argument exceptions
public:
typedef logic_error _Mybase;
explicit invalid_argument(const string& _Message)
: _Mybase(_Message.c_str())
{ // construct from message string
}
explicit invalid_argument(const char *_Message)
: _Mybase(_Message)
{ // construct from message string
}
#if _HAS_EXCEPTIONS
#else /* _HAS_EXCEPTIONS */
protected:
virtual void _Doraise() const
{ // perform class-specific exception handling
_RAISE(*this);
}
#endif /* _HAS_EXCEPTIONS */
};
// CLASS length_error
class length_error
: public logic_error
{ // base of all length-error exceptions
public:
typedef logic_error _Mybase;
explicit length_error(const string& _Message)
: _Mybase(_Message.c_str())
{ // construct from message string
}
explicit length_error(const char *_Message)
: _Mybase(_Message)
{ // construct from message string
}
#if _HAS_EXCEPTIONS
#else /* _HAS_EXCEPTIONS */
protected:
virtual void _Doraise() const
{ // perform class-specific exception handling
_RAISE(*this);
}
#endif /* _HAS_EXCEPTIONS */
};
// CLASS out_of_range
class out_of_range
: public logic_error
{ // base of all out-of-range exceptions
public:
typedef logic_error _Mybase;
explicit out_of_range(const string& _Message)
: _Mybase(_Message.c_str())
{ // construct from message string
}
explicit out_of_range(const char *_Message)
: _Mybase(_Message)
{ // construct from message string
}
#if _HAS_EXCEPTIONS
#else /* _HAS_EXCEPTIONS */
protected:
virtual void _Doraise() const
{ // perform class-specific exception handling
_RAISE(*this);
}
#endif /* _HAS_EXCEPTIONS */
};
// CLASS runtime_error
class runtime_error
: public exception
{ // base of all runtime-error exceptions
public:
typedef exception _Mybase;
explicit runtime_error(const string& _Message)
: _Mybase(_Message.c_str())
{ // construct from message string
}
explicit runtime_error(const char *_Message)
: _Mybase(_Message)
{ // construct from message string
}
#if _HAS_EXCEPTIONS
#else /* _HAS_EXCEPTIONS */
protected:
virtual void _Doraise() const
{ // perform class-specific exception handling
_RAISE(*this);
}
#endif /* _HAS_EXCEPTIONS */
};
// CLASS overflow_error
class overflow_error
: public runtime_error
{ // base of all overflow-error exceptions
public:
typedef runtime_error _Mybase;
explicit overflow_error(const string& _Message)
: _Mybase(_Message.c_str())
{ // construct from message string
}
explicit overflow_error(const char *_Message)
: _Mybase(_Message)
{ // construct from message string
}
#if _HAS_EXCEPTIONS
#else /* _HAS_EXCEPTIONS */
protected:
virtual void _Doraise() const
{ // perform class-specific exception handling
_RAISE(*this);
}
#endif /* _HAS_EXCEPTIONS */
};
// CLASS underflow_error
class underflow_error
: public runtime_error
{ // base of all underflow-error exceptions
public:
typedef runtime_error _Mybase;
explicit underflow_error(const string& _Message)
: _Mybase(_Message.c_str())
{ // construct from message string
}
explicit underflow_error(const char *_Message)
: _Mybase(_Message)
{ // construct from message string
}
#if _HAS_EXCEPTIONS
#else /* _HAS_EXCEPTIONS */
protected:
virtual void _Doraise() const
{ // perform class-specific exception handling
_RAISE(*this);
}
#endif /* _HAS_EXCEPTIONS */
};
// CLASS range_error
class range_error
: public runtime_error
{ // base of all range-error exceptions
public:
typedef runtime_error _Mybase;
explicit range_error(const string& _Message)
: _Mybase(_Message.c_str())
{ // construct from message string
}
explicit range_error(const char *_Message)
: _Mybase(_Message)
{ // construct from message string
}
#if _HAS_EXCEPTIONS
#else /* _HAS_EXCEPTIONS */
protected:
virtual void _Doraise() const
{ // perform class-specific exception handling
_RAISE(*this);
}
#endif /* _HAS_EXCEPTIONS */
};
_STD_END
#pragma warning(pop)
#pragma pack(pop)
#endif /* RC_INVOKED */
#endif /* _STDEXCEPT_ */
/*
* Copyright (c) 1992-2009 by P.J. Plauger. ALL RIGHTS RESERVED.
* Consult your license regarding permissions and restrictions.
V5.20:0009 */
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -