| 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 unique_resource_ref_ctor_rv.cpp |
| 10 | * \author Andrey Semashev |
| 11 | * |
| 12 | * \brief This file tests that \c unique_resource for reference types is not constructible from rvalues. |
| 13 | */ |
| 14 | |
| 15 | #include <boost/scope/unique_resource.hpp> |
| 16 | |
| 17 | template< typename Resource > |
| 18 | struct empty_resource_deleter |
| 19 | { |
| 20 | void operator() (Resource const& res) const noexcept |
| 21 | { |
| 22 | } |
| 23 | }; |
| 24 | |
| 25 | int main() |
| 26 | { |
| 27 | boost::scope::unique_resource< int const&, empty_resource_deleter< int const& > > ur1{ 10, empty_resource_deleter< int const& >() }; |
| 28 | |
| 29 | return 0; |
| 30 | } |
| 31 | |