Back to home page

EIC code displayed by LXR

 
 

    


Warning, /include/c++/v1/system_error is written in an unsupported language. File is not indexed.

0001 // -*- C++ -*-
0002 //===----------------------------------------------------------------------===//
0003 //
0004 // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
0005 // See https://llvm.org/LICENSE.txt for license information.
0006 // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
0007 //
0008 //===----------------------------------------------------------------------===//
0009 
0010 #ifndef _LIBCPP_SYSTEM_ERROR
0011 #define _LIBCPP_SYSTEM_ERROR
0012 
0013 /*
0014     system_error synopsis
0015 
0016 namespace std
0017 {
0018 
0019 class error_category
0020 {
0021 public:
0022     virtual ~error_category() noexcept;
0023 
0024     constexpr error_category();
0025     error_category(const error_category&) = delete;
0026     error_category& operator=(const error_category&) = delete;
0027 
0028     virtual const char* name() const noexcept = 0;
0029     virtual error_condition default_error_condition(int ev) const noexcept;
0030     virtual bool equivalent(int code, const error_condition& condition) const noexcept;
0031     virtual bool equivalent(const error_code& code, int condition) const noexcept;
0032     virtual string message(int ev) const = 0;
0033 
0034     bool operator==(const error_category& rhs) const noexcept;
0035     bool operator!=(const error_category& rhs) const noexcept;              // removed in C++20
0036     bool operator<(const error_category& rhs) const noexcept;               // removed in C++20
0037     strong_ordering operator<=>(const error_category& rhs) const noexcept;  // C++20
0038 };
0039 
0040 const error_category& generic_category() noexcept;
0041 const error_category& system_category() noexcept;
0042 
0043 template <class T> struct is_error_code_enum
0044     : public false_type {};
0045 
0046 template <class T> struct is_error_condition_enum
0047     : public false_type {};
0048 
0049 template <class _Tp>
0050 inline constexpr bool is_error_condition_enum_v = is_error_condition_enum<_Tp>::value; // C++17
0051 
0052 template <class _Tp>
0053 inline constexpr bool is_error_code_enum_v = is_error_code_enum<_Tp>::value; // C++17
0054 
0055 class error_code
0056 {
0057 public:
0058     // constructors:
0059     error_code() noexcept;
0060     error_code(int val, const error_category& cat) noexcept;
0061     template <class ErrorCodeEnum>
0062         error_code(ErrorCodeEnum e) noexcept;
0063 
0064     // modifiers:
0065     void assign(int val, const error_category& cat) noexcept;
0066     template <class ErrorCodeEnum>
0067         error_code& operator=(ErrorCodeEnum e) noexcept;
0068     void clear() noexcept;
0069 
0070     // observers:
0071     int value() const noexcept;
0072     const error_category& category() const noexcept;
0073     error_condition default_error_condition() const noexcept;
0074     string message() const;
0075     explicit operator bool() const noexcept;
0076 };
0077 
0078 // non-member functions:
0079 template <class charT, class traits>
0080     basic_ostream<charT,traits>&
0081     operator<<(basic_ostream<charT,traits>& os, const error_code& ec);
0082 
0083 class error_condition
0084 {
0085 public:
0086     // constructors:
0087     error_condition() noexcept;
0088     error_condition(int val, const error_category& cat) noexcept;
0089     template <class ErrorConditionEnum>
0090         error_condition(ErrorConditionEnum e) noexcept;
0091 
0092     // modifiers:
0093     void assign(int val, const error_category& cat) noexcept;
0094     template <class ErrorConditionEnum>
0095         error_condition& operator=(ErrorConditionEnum e) noexcept;
0096     void clear() noexcept;
0097 
0098     // observers:
0099     int value() const noexcept;
0100     const error_category& category() const noexcept;
0101     string message() const noexcept;
0102     explicit operator bool() const noexcept;
0103 };
0104 
0105 class system_error
0106     : public runtime_error
0107 {
0108 public:
0109     system_error(error_code ec, const string& what_arg);
0110     system_error(error_code ec, const char* what_arg);
0111     system_error(error_code ec);
0112     system_error(int ev, const error_category& ecat, const string& what_arg);
0113     system_error(int ev, const error_category& ecat, const char* what_arg);
0114     system_error(int ev, const error_category& ecat);
0115 
0116     const error_code& code() const noexcept;
0117     const char* what() const noexcept;
0118 };
0119 
0120 template <> struct is_error_condition_enum<errc>
0121     : true_type { }
0122 
0123 error_code make_error_code(errc e) noexcept;
0124 error_condition make_error_condition(errc e) noexcept;
0125 
0126 // Comparison operators:
0127 bool operator==(const error_code& lhs, const error_code& rhs) noexcept;
0128 bool operator==(const error_code& lhs, const error_condition& rhs) noexcept;
0129 bool operator==(const error_condition& lhs, const error_code& rhs) noexcept;                  // removed in C++20
0130 bool operator==(const error_condition& lhs, const error_condition& rhs) noexcept;
0131 bool operator!=(const error_code& lhs, const error_code& rhs) noexcept;                       // removed in C++20
0132 bool operator!=(const error_code& lhs, const error_condition& rhs) noexcept;                  // removed in C++20
0133 bool operator!=(const error_condition& lhs, const error_code& rhs) noexcept;                  // removed in C++20
0134 bool operator!=(const error_condition& lhs, const error_condition& rhs) noexcept;             // removed in C++20
0135 bool operator<(const error_condition& lhs, const error_condition& rhs) noexcept;              // removed in C++20
0136 bool operator<(const error_code& lhs, const error_code& rhs) noexcept;                        // removed in C++20
0137 strong_ordering operator<=>(const error_code& lhs, const error_code& rhs) noexcept;           // C++20
0138 strong_ordering operator<=>(const error_condition& lhs, const error_condition& rhs) noexcept; // C++20
0139 
0140 template <> struct hash<std::error_code>;
0141 template <> struct hash<std::error_condition>;
0142 
0143 }  // std
0144 
0145 */
0146 
0147 #if __cplusplus < 201103L && defined(_LIBCPP_USE_FROZEN_CXX03_HEADERS)
0148 #  include <__cxx03/system_error>
0149 #else
0150 #  include <__config>
0151 #  include <__system_error/errc.h>
0152 #  include <__system_error/error_category.h>
0153 #  include <__system_error/error_code.h>
0154 #  include <__system_error/error_condition.h>
0155 #  include <__system_error/system_error.h>
0156 #  include <version>
0157 
0158 // standard-mandated includes
0159 
0160 // [system.error.syn]
0161 #  include <compare>
0162 
0163 #  if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
0164 #    pragma GCC system_header
0165 #  endif
0166 
0167 #  if !defined(_LIBCPP_REMOVE_TRANSITIVE_INCLUDES) && _LIBCPP_STD_VER <= 20
0168 #    include <cstdint>
0169 #    include <cstring>
0170 #    include <limits>
0171 #    include <type_traits>
0172 #  endif
0173 #endif // __cplusplus < 201103L && defined(_LIBCPP_USE_FROZEN_CXX03_HEADERS)
0174 
0175 #endif // _LIBCPP_SYSTEM_ERROR