1 //===----------------------------------------------------------------------===//
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
7 //===----------------------------------------------------------------------===//
11 #ifdef _LIBCPP_DEPRECATED_ABI_LEGACY_LIBRARY_DEFINITIONS_FOR_INLINE_FUNCTIONS
12 # define _LIBCPP_ERROR_CATEGORY_DEFINE_LEGACY_INLINE_FUNCTIONS
15 #include <system_error>
17 _LIBCPP_BEGIN_NAMESPACE_STD
19 // class error_category
21 #if defined(_LIBCPP_ERROR_CATEGORY_DEFINE_LEGACY_INLINE_FUNCTIONS)
22 error_category::error_category() noexcept
{}
25 error_category::~error_category() noexcept
{}
27 error_condition
error_category::default_error_condition(int ev
) const noexcept
{ return error_condition(ev
, *this); }
29 bool error_category::equivalent(int code
, const error_condition
& condition
) const noexcept
{
30 return default_error_condition(code
) == condition
;
33 bool error_category::equivalent(const error_code
& code
, int condition
) const noexcept
{
34 return *this == code
.category() && code
.value() == condition
;
37 _LIBCPP_END_NAMESPACE_STD