unique_fd.hpp 942 B

1234567891011121314151617181920212223242526272829303132333435363738
  1. /*
  2. * Distributed under the Boost Software License, Version 1.0.
  3. * (See accompanying file LICENSE_1_0.txt or copy at
  4. * https://www.boost.org/LICENSE_1_0.txt)
  5. *
  6. * Copyright (c) 2023 Andrey Semashev
  7. */
  8. /*!
  9. * \file scope/unique_fd.hpp
  10. *
  11. * This header contains definition of \c unique_fd type.
  12. */
  13. #ifndef BOOST_SCOPE_UNIQUE_FD_HPP_INCLUDED_
  14. #define BOOST_SCOPE_UNIQUE_FD_HPP_INCLUDED_
  15. #include <boost/scope/detail/config.hpp>
  16. #include <boost/scope/unique_resource.hpp>
  17. #include <boost/scope/fd_deleter.hpp>
  18. #include <boost/scope/fd_resource_traits.hpp>
  19. #include <boost/scope/detail/header.hpp>
  20. #ifdef BOOST_HAS_PRAGMA_ONCE
  21. #pragma once
  22. #endif
  23. namespace boost {
  24. namespace scope {
  25. //! Unique POSIX-like file descriptor resource
  26. using unique_fd = unique_resource< int, fd_deleter, fd_resource_traits >;
  27. } // namespace scope
  28. } // namespace boost
  29. #include <boost/scope/detail/footer.hpp>
  30. #endif // BOOST_SCOPE_UNIQUE_FD_HPP_INCLUDED_