system_error.hpp 1.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657
  1. //
  2. // Copyright (c) 2019 Vinnie Falco (vinnie.falco@gmail.com)
  3. //
  4. // Distributed under the Boost Software License, Version 1.0. (See accompanying
  5. // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
  6. //
  7. // Official repository: https://github.com/boostorg/json
  8. //
  9. #ifndef BOOST_JSON_SYSTEM_ERROR_HPP
  10. #define BOOST_JSON_SYSTEM_ERROR_HPP
  11. #include <boost/json/detail/config.hpp>
  12. #ifndef BOOST_JSON_STANDALONE
  13. # include <boost/system/error_code.hpp>
  14. # include <boost/system/system_error.hpp>
  15. #else
  16. # include <system_error>
  17. #endif
  18. BOOST_JSON_NS_BEGIN
  19. #ifndef BOOST_JSON_STANDALONE
  20. /// The type of error code used by the library.
  21. using error_code = boost::system::error_code;
  22. /// The type of error category used by the library.
  23. using error_category = boost::system::error_category;
  24. /// The type of error condition used by the library.
  25. using error_condition = boost::system::error_condition;
  26. /// The type of system error thrown by the library.
  27. using system_error = boost::system::system_error;
  28. #ifdef BOOST_JSON_DOCS
  29. /// Returns the generic error category used by the library.
  30. error_category const&
  31. generic_category();
  32. #else
  33. using boost::system::generic_category;
  34. #endif
  35. #else
  36. using error_code = std::error_code;
  37. using error_category = std::error_category;
  38. using error_condition = std::error_condition;
  39. using system_error = std::system_error;
  40. using std::generic_category;
  41. #endif
  42. BOOST_JSON_NS_END
  43. #endif