mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-06-11 06:38:20 +00:00
Support/SystemError: Make error_category and error_code auto-bool-conversion-safe.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@120869 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
@ -708,8 +708,12 @@ public:
|
|||||||
const error_category& category() const {return *_cat_;}
|
const error_category& category() const {return *_cat_;}
|
||||||
std::string message() const;
|
std::string message() const;
|
||||||
|
|
||||||
// explicit
|
typedef void (*unspecified_bool_type)();
|
||||||
operator bool() const {return _val_ != 0;}
|
static void unspecified_bool_true() {}
|
||||||
|
|
||||||
|
operator unspecified_bool_type() const { // true if error
|
||||||
|
return _val_ == 0 ? 0 : unspecified_bool_true;
|
||||||
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
inline error_condition make_error_condition(errc _e) {
|
inline error_condition make_error_condition(errc _e) {
|
||||||
@ -767,8 +771,12 @@ public:
|
|||||||
|
|
||||||
std::string message() const;
|
std::string message() const;
|
||||||
|
|
||||||
// explicit
|
typedef void (*unspecified_bool_type)();
|
||||||
operator bool() const {return _val_ != 0;}
|
static void unspecified_bool_true() {}
|
||||||
|
|
||||||
|
operator unspecified_bool_type() const { // true if error
|
||||||
|
return _val_ == 0 ? 0 : unspecified_bool_true;
|
||||||
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
inline error_code make_error_code(errc _e) {
|
inline error_code make_error_code(errc _e) {
|
||||||
|
Reference in New Issue
Block a user