| Technical Specification | ||||
| Filesystem library(filesystem TS) | ||||
| Library fundamentals(library fundamentals TS) | ||||
| Library fundamentals 2(library fundamentals TS v2) | ||||
| Library fundamentals 3(library fundamentals TS v3) | ||||
| Extensions for parallelism(parallelism TS) | ||||
| Extensions for parallelism 2(parallelism TS v2) | ||||
| Extensions for concurrency(concurrency TS) | ||||
| Extensions for concurrency 2(concurrency TS v2) | ||||
| Concepts(concepts TS) | ||||
| Ranges(ranges TS) | ||||
| Reflection(reflection TS) | ||||
| Mathematical special functions(special functions TR) | ||||
| Experimental Non-TS | ||||
| Pattern Matching | ||||
| Linear Algebra | ||||
| std::execution | ||||
| Contracts | ||||
| 2D Graphics |
| Member functions | ||||
scope_exit::scope_exit | ||||
| Modifiers | ||||
| Deduction guides |
template<class Fn> explicit scope_exit( Fn&& fn)noexcept(/*see below*/); | (1) | (library fundamentals TS v3) |
scope_exit( scope_exit&& other)noexcept(/*see below*/); | (2) | (library fundamentals TS v3) |
scope_exit(const scope_exit&)= delete; | (3) | (library fundamentals TS v3) |
Creates ascope_exit from a function, a function object or anotherscope_exit.
scope_exit is active.Fn is not an lvalue reference type andstd::is_nothrow_constructible_v<EF, Fn> istrue, the storedEF is initialized withstd::forward<Fn>(fn); otherwise it is initialized withfn.EF throws an exception, callsfn().EF with the one inother. The constructedscope_exit is active if and only ifother is active before the construction.EF (denoted byexitfun) withstd::forward<EF>(other.exitfun), otherwise initializes it withother.exitfun.EF does not meet the requirements ofMoveConstructible, orEF does not meet the requirements ofCopyConstructible.Contents |
| fn | - | function or function object used for initializing the storedEF |
| other | - | scope_exit to move from |
Any exception thrown during the initialization of the storedEF.
| This section is incomplete Reason: no example |
makes thescope_exit inactive(public member function)[edit] |