2
0
mirror of https://github.com/boostorg/scope.git synced 2026-01-19 16:52:08 +00:00
Files
scope/test/compile_fail/scope_success_noncopyable.cpp
2023-02-24 19:30:55 +03:00

26 lines
601 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 scope_success_noncopyable.cpp
* \author Andrey Semashev
*
* \brief This file tests that \c scope_exit is noncopyable.
*/
#include <boost/scope/scope_success.hpp>
#include "function_types.hpp"
int main()
{
int n = 0;
boost::scope::scope_success< normal_func > guard1{ normal_func(n) };
boost::scope::scope_success< normal_func > guard2 = guard1;
return 0;
}