Remove some low hanging fruit from system_error.h

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@210728 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Rafael Espindola 2014-06-12 01:10:47 +00:00
parent 9387d058a4
commit e964d1d6dd
2 changed files with 9 additions and 10 deletions

View File

@ -94,9 +94,10 @@ private:
public:
template <class E>
ErrorOr(E ErrorCode, typename std::enable_if<is_error_code_enum<E>::value ||
is_error_condition_enum<E>::value,
void *>::type = 0)
ErrorOr(E ErrorCode,
typename std::enable_if<std::is_error_code_enum<E>::value ||
std::is_error_condition_enum<E>::value,
void *>::type = 0)
: HasError(true) {
new (getErrorStorage()) error_code(make_error_code(ErrorCode));
}
@ -264,10 +265,11 @@ private:
bool HasError : 1;
};
template<class T, class E>
typename std::enable_if<is_error_code_enum<E>::value ||
is_error_condition_enum<E>::value, bool>::type
operator ==(ErrorOr<T> &Err, E Code) {
template <class T, class E>
typename std::enable_if<std::is_error_code_enum<E>::value ||
std::is_error_condition_enum<E>::value,
bool>::type
operator==(ErrorOr<T> &Err, E Code) {
return error_code(Err) == Code;
}
} // end namespace llvm

View File

@ -18,9 +18,6 @@
namespace llvm {
using std::error_code;
using std::is_error_condition_enum;
using std::is_error_code_enum;
using std::system_category;
using std::generic_category;
using std::error_category;
using std::make_error_code;