mirror of
https://github.com/boostorg/compat.git
synced 2026-01-19 04:02:16 +00:00
Move detal::throw_system_error to a separate header
This commit is contained in:
25
include/boost/compat/detail/throw_system_error.hpp
Normal file
25
include/boost/compat/detail/throw_system_error.hpp
Normal file
@@ -0,0 +1,25 @@
|
||||
#ifndef BOOST_COMPAT_DETAIL_THROW_SYSTEM_ERROR_HPP_INCLUDED
|
||||
#define BOOST_COMPAT_DETAIL_THROW_SYSTEM_ERROR_HPP_INCLUDED
|
||||
|
||||
// Copyright 2023 Peter Dimov
|
||||
// Distributed under the Boost Software License, Version 1.0.
|
||||
// https://www.boost.org/LICENSE_1_0.txt
|
||||
|
||||
#include <boost/throw_exception.hpp>
|
||||
#include <boost/config.hpp>
|
||||
#include <system_error>
|
||||
|
||||
namespace boost {
|
||||
namespace compat {
|
||||
namespace detail {
|
||||
|
||||
BOOST_NORETURN BOOST_NOINLINE inline void throw_system_error( std::errc e, boost::source_location const& loc = BOOST_CURRENT_LOCATION )
|
||||
{
|
||||
boost::throw_exception( std::system_error( std::make_error_code( e ) ), loc );
|
||||
}
|
||||
|
||||
} // namespace detail
|
||||
} // namespace compat
|
||||
} // namespace boost
|
||||
|
||||
#endif // BOOST_COMPAT_DETAIL_THROW_SYSTEM_ERROR_HPP_INCLUDED
|
||||
@@ -5,12 +5,11 @@
|
||||
// Distributed under the Boost Software License, Version 1.0.
|
||||
// https://www.boost.org/LICENSE_1_0.txt
|
||||
|
||||
#include <boost/throw_exception.hpp>
|
||||
#include <boost/config.hpp>
|
||||
#include <boost/compat/detail/throw_system_error.hpp>
|
||||
|
||||
#include <memory>
|
||||
#include <mutex>
|
||||
#include <system_error>
|
||||
#include <memory> // std::addressof
|
||||
#include <mutex> // std::defer_lock_t
|
||||
#include <system_error> // std::errc
|
||||
|
||||
namespace boost {
|
||||
namespace compat {
|
||||
@@ -21,14 +20,6 @@ class shared_lock;
|
||||
template <class Mutex>
|
||||
void swap( shared_lock<Mutex>& x, shared_lock<Mutex>& y ) noexcept;
|
||||
|
||||
namespace detail {
|
||||
|
||||
BOOST_NORETURN BOOST_NOINLINE inline void
|
||||
throw_system_error( std::errc e, boost::source_location const& loc = BOOST_CURRENT_LOCATION ) {
|
||||
boost::throw_exception( std::system_error( std::make_error_code( e ) ), loc );
|
||||
}
|
||||
} // namespace detail
|
||||
|
||||
template <class Mutex>
|
||||
class shared_lock {
|
||||
private:
|
||||
|
||||
Reference in New Issue
Block a user