errc.hpp 1.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657
  1. #ifndef BOOST_SYSTEM_ERRC_HPP_INCLUDED
  2. #define BOOST_SYSTEM_ERRC_HPP_INCLUDED
  3. // Copyright Beman Dawes 2006, 2007
  4. // Copyright Christoper Kohlhoff 2007
  5. // Copyright Peter Dimov 2017, 2018, 2020
  6. //
  7. // Distributed under the Boost Software License, Version 1.0. (See accompanying
  8. // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
  9. //
  10. // See library home page at http://www.boost.org/libs/system
  11. #include <boost/system/detail/errc.hpp>
  12. #include <boost/system/detail/error_code.hpp>
  13. #include <boost/system/detail/error_condition.hpp>
  14. #include <boost/system/detail/generic_category.hpp>
  15. #include <boost/system/detail/error_category_impl.hpp>
  16. #include <boost/system/detail/config.hpp>
  17. #include <boost/assert/source_location.hpp>
  18. #include <boost/config.hpp>
  19. namespace boost
  20. {
  21. namespace system
  22. {
  23. // make_* functions for errc::errc_t
  24. namespace errc
  25. {
  26. // explicit conversion:
  27. BOOST_SYSTEM_CONSTEXPR inline error_code make_error_code( errc_t e ) noexcept
  28. {
  29. return error_code( e, generic_category() );
  30. }
  31. // explicit conversion:
  32. inline error_code make_error_code( errc_t e, boost::source_location const * loc ) noexcept
  33. {
  34. return error_code( e, generic_category(), loc );
  35. }
  36. // implicit conversion:
  37. BOOST_SYSTEM_CONSTEXPR inline error_condition make_error_condition( errc_t e ) noexcept
  38. {
  39. return error_condition( e, generic_category() );
  40. }
  41. } // namespace errc
  42. } // namespace system
  43. } // namespace boost
  44. #endif // #ifndef BOOST_SYSTEM_ERRC_HPP_INCLUDED