38 lines · cpp
1//===----------------------------------------------------------------------===//2//3// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.4// See https://llvm.org/LICENSE.txt for license information.5// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception6//7//===----------------------------------------------------------------------===//8 9#include <__config>10 11#ifdef _LIBCPP_DEPRECATED_ABI_LEGACY_LIBRARY_DEFINITIONS_FOR_INLINE_FUNCTIONS12# define _LIBCPP_ERROR_CATEGORY_DEFINE_LEGACY_INLINE_FUNCTIONS13#endif14 15#include <system_error>16 17_LIBCPP_BEGIN_NAMESPACE_STD18 19// class error_category20 21#if defined(_LIBCPP_ERROR_CATEGORY_DEFINE_LEGACY_INLINE_FUNCTIONS)22error_category::error_category() noexcept {}23#endif24 25error_category::~error_category() noexcept {}26 27error_condition error_category::default_error_condition(int ev) const noexcept { return error_condition(ev, *this); }28 29bool error_category::equivalent(int code, const error_condition& condition) const noexcept {30 return default_error_condition(code) == condition;31}32 33bool error_category::equivalent(const error_code& code, int condition) const noexcept {34 return *this == code.category() && code.value() == condition;35}36 37_LIBCPP_END_NAMESPACE_STD38