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