2
0
mirror of https://github.com/boostorg/scope.git synced 2026-01-19 04:42:10 +00:00
Files
scope/test/compile_fail/defer_guard_noncopyable.cpp
Andrey Semashev b0117a4b2e Renamed scope_final to defer_guard and BOOST_SCOPE_FINAL to BOOST_SCOPE_DEFER.
This follows the suggestion by Peter Dimov during the review.
2024-01-19 01:13:26 +03:00

26 lines
588 B
C++

/*
* Distributed under the Boost Software License, Version 1.0.
* (See accompanying file LICENSE_1_0.txt or copy at
* https://www.boost.org/LICENSE_1_0.txt)
*
* Copyright (c) 2023 Andrey Semashev
*/
/*!
* \file defer_guard_noncopyable.cpp
* \author Andrey Semashev
*
* \brief This file tests that \c defer_guard is noncopyable.
*/
#include <boost/scope/defer.hpp>
#include "function_types.hpp"
int main()
{
int n = 0;
boost::scope::defer_guard< normal_func > guard1{ normal_func(n) };
boost::scope::defer_guard< normal_func > guard2 = guard1;
return 0;
}