throw_error.hpp 857 B

123456789101112131415161718192021222324252627282930313233
  1. // Copyright (c) 2022 Klemens D. Morgenstern
  2. //
  3. // Distributed under the Boost Software License, Version 1.0. (See accompanying
  4. // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
  5. #ifndef BOOST_PROCESS_V2_DETAIL_THROW_ERROR_HPP
  6. #define BOOST_PROCESS_V2_DETAIL_THROW_ERROR_HPP
  7. #include <boost/process/v2/detail/config.hpp>
  8. BOOST_PROCESS_V2_BEGIN_NAMESPACE
  9. namespace detail
  10. {
  11. BOOST_PROCESS_V2_DECL void do_throw_error(const error_code& err);
  12. BOOST_PROCESS_V2_DECL void do_throw_error(const error_code& err, const char* location);
  13. inline void throw_error(const error_code& err)
  14. {
  15. if (err)
  16. do_throw_error(err);
  17. }
  18. inline void throw_error(const error_code& err, const char* location)
  19. {
  20. if (err)
  21. do_throw_error(err, location);
  22. }
  23. }
  24. BOOST_PROCESS_V2_END_NAMESPACE
  25. #endif //BOOST_PROCESS_V2_DETAIL_THROW_ERROR_HPP