| 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 defer_guard_nonmoveable.cpp |
| 10 | * \author Andrey Semashev |
| 11 | * |
| 12 | * \brief This file tests that \c defer_guard is nonmoveable. |
| 13 | */ |
| 14 | |
| 15 | #include <boost/scope/defer.hpp> |
| 16 | #include <utility> |
| 17 | #include "function_types.hpp" |
| 18 | |
| 19 | int main() |
| 20 | { |
| 21 | int n = 0; |
| 22 | boost::scope::defer_guard< normal_func > guard1{ normal_func(n) }; |
| 23 | boost::scope::defer_guard< normal_func > guard2 = std::move(guard1); |
| 24 | |
| 25 | return 0; |
| 26 | } |
| 27 |
