except.hpp 894 B

1234567891011121314151617181920212223242526272829303132333435363738394041
  1. //
  2. // Copyright (c) 2019 Vinnie Falco ([email protected])
  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_DETAIL_EXCEPT_HPP
  10. #define BOOST_JSON_DETAIL_EXCEPT_HPP
  11. #include <boost/json/error.hpp>
  12. namespace boost {
  13. namespace json {
  14. namespace detail {
  15. #define BOOST_JSON_FAIL(ec, e) \
  16. BOOST_STATIC_CONSTEXPR source_location loc = BOOST_CURRENT_LOCATION; \
  17. (ec).assign(e, &loc);
  18. BOOST_JSON_DECL
  19. void
  20. BOOST_NORETURN
  21. throw_system_error(
  22. system::error_code const& ec,
  23. source_location const& loc = BOOST_CURRENT_LOCATION);
  24. BOOST_JSON_DECL
  25. void
  26. BOOST_NORETURN
  27. throw_system_error(
  28. error e,
  29. source_location const* loc);
  30. } // detail
  31. } // namespace json
  32. } // namespace boost
  33. #endif