| 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) 2022 Andrey Semashev |
| 7 | */ |
| 8 | /*! |
| 9 | * \file scope/unique_resource_fwd.hpp |
| 10 | * |
| 11 | * This header contains forward declaration of \c unique_resource template. |
| 12 | */ |
| 13 | |
| 14 | #ifndef BOOST_SCOPE_UNIQUE_RESOURCE_FWD_HPP_INCLUDED_ |
| 15 | #define BOOST_SCOPE_UNIQUE_RESOURCE_FWD_HPP_INCLUDED_ |
| 16 | |
| 17 | #include <type_traits> |
| 18 | #include <boost/scope/detail/config.hpp> |
| 19 | #include <boost/scope/detail/move_or_copy_construct_ref.hpp> |
| 20 | #include <boost/scope/detail/type_traits/conjunction.hpp> |
| 21 | #include <boost/scope/detail/header.hpp> |
| 22 | |
| 23 | #ifdef BOOST_HAS_PRAGMA_ONCE |
| 24 | #pragma once |
| 25 | #endif |
| 26 | |
| 27 | namespace boost { |
| 28 | namespace scope { |
| 29 | |
| 30 | template< typename Resource, typename Deleter, typename Traits = void > |
| 31 | class unique_resource; |
| 32 | |
| 33 | template< typename Resource, typename Deleter, typename Invalid = typename std::decay< Resource >::type > |
| 34 | unique_resource< typename std::decay< Resource >::type, typename std::decay< Deleter >::type > |
| 35 | make_unique_resource_checked(Resource&& res, Invalid const& invalid, Deleter&& del) |
| 36 | noexcept(BOOST_SCOPE_DETAIL_DOC_HIDDEN(detail::conjunction< |
| 37 | std::is_nothrow_constructible< typename std::decay< Resource >::type, typename detail::move_or_copy_construct_ref< Resource, typename std::decay< Resource >::type >::type >, |
| 38 | std::is_nothrow_constructible< typename std::decay< Deleter >::type, typename detail::move_or_copy_construct_ref< Deleter, typename std::decay< Deleter >::type >::type > |
| 39 | >::value)); |
| 40 | |
| 41 | } // namespace scope |
| 42 | } // namespace boost |
| 43 | |
| 44 | #include <boost/scope/detail/footer.hpp> |
| 45 | |
| 46 | #endif // BOOST_SCOPE_UNIQUE_RESOURCE_FWD_HPP_INCLUDED_ |
| 47 | |