2
0
mirror of https://github.com/boostorg/scope.git synced 2026-01-26 07:02:09 +00:00
Files
scope/test/compile_fail/scope_exit_noncopyable.cpp
Andrey Semashev 9f55473af2 Initial commit.
2023-01-10 02:18:35 +03:00

25 lines
606 B
C++

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