llvm-project
37 строк · 1.2 Кб
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-exception
6//
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_STD
18
19// class error_category
20
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 {30return default_error_condition(code) == condition;31}
32
33bool error_category::equivalent(const error_code& code, int condition) const noexcept {34return *this == code.category() && code.value() == condition;35}
36
37_LIBCPP_END_NAMESPACE_STD
38