std::experimental::scope_exit<EF>::scope_exit
来自cppreference.com
                    
                                        
                    < cpp | experimental | scope exit
                    
                                                            
                    
|   template <class Fn> explicit scope_exit( Fn&& fn ) noexcept(/*see below*/);  | 
(1) | (库基础 TS v3) | 
|   scope_exit( scope_exit&& other ) noexcept(/*see below*/);  | 
(2) | (库基础 TS v3) | 
|   scope_exit( const scope_exit& ) = delete;  | 
(3) | (库基础 TS v3) | 
从函数、函数对象或另一 scope_exit 创建 scope_exit 。
1) 以函数或函数对象初始化退出函数。构造的 
scope_exit 为活跃。 若 
Fn 不是左值引用类型且 std::is_nothrow_constructible_v<EF, Fn> 为 true ,则以 std::forward<Fn>(fn) ,否则以 fn 初始化存储的 EF 。 若初始化存储的 
EF 抛异常,则调用 fn() 。 此重载只有在 std::is_same_v<std::remove_cvref_t<Fn>, scope_exit> 为 false 且 std::is_constructible_v<EF, Fn> 为 true 时才会参与重载决议。
 若函数调用表达式 fn() 为谬构,则程序为谬构。
 若调用 fn() 抛出异常或导致未定义行为,则行为未定义,即使未调用 
fn 。2) 移动构造函数。以 
other 的存储的 EF 初始化存储的 EF 。构造的 scope_exit 为活跃当且仅当 other 在构造前活跃。 若 std::is_nothrow_move_constructible_v<EF> 为 true ,则以 std::forward<EF>(other.exitfun) ,否则以 other.exitfun 初始化存储的 
EF (以 exitfun 代表)。 在成功移动构造后调用 other.release() 而 
other 变为不活跃。 此重载只有在 std::is_nothrow_move_constructible_v<EF> 为 true 或 std::is_copy_constructible_v<EF> 为 true 时才会参与重载决议。
 若有下列情况则行为未定义
-  std::is_nothrow_move_constructible_v<EF> 为 true 而 
EF不满足可移动构造 (MoveConstructible) 的要求,或 -  std::is_nothrow_move_constructible_v<EF> 为 false 而 
EF不满足可复制构造 (CopyConstructible) 的要求。 
参数
| fn | - |   用于初始化存储的 EF 的函数或函数对象
 | 
| other | - |   要移动的 scope_exit
 | 
异常
初始化存储的 EF 期间抛出的任何异常。
1) 
noexcept 说明:  
noexcept(std::is_nothrow_constructible_v<EF, Fn> ||
std::is_nothrow_constructible_v<EF, Fn&>)
std::is_nothrow_constructible_v<EF, Fn&>)
2) 
noexcept 说明:  
noexcept(std::is_nothrow_move_constructible_v<EF> ||
std::is_nothrow_copy_constructible_v<EF>)
std::is_nothrow_copy_constructible_v<EF>)
示例
| 本节未完成 原因:暂无示例  | 
参阅
   使 scope_exit 不活跃  (公开成员函数)  |