error.hpp 1.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061
  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_IMPL_ERROR_HPP
  10. #define BOOST_JSON_IMPL_ERROR_HPP
  11. #include <type_traits>
  12. #ifndef BOOST_JSON_STANDALONE
  13. namespace boost {
  14. namespace system {
  15. template<>
  16. struct is_error_code_enum< ::boost::json::error >
  17. {
  18. static bool const value = true;
  19. };
  20. template<>
  21. struct is_error_condition_enum< ::boost::json::condition >
  22. {
  23. static bool const value = true;
  24. };
  25. } // system
  26. } // boost
  27. #else
  28. namespace std {
  29. template<>
  30. struct is_error_code_enum< ::boost::json::error >
  31. {
  32. static bool const value = true;
  33. };
  34. template<>
  35. struct is_error_condition_enum< ::boost::json::condition >
  36. {
  37. static bool const value = true;
  38. };
  39. } // std
  40. #endif
  41. BOOST_JSON_NS_BEGIN
  42. BOOST_JSON_DECL
  43. error_code
  44. make_error_code(error e);
  45. BOOST_JSON_DECL
  46. error_condition
  47. make_error_condition(condition c);
  48. BOOST_JSON_NS_END
  49. #endif