Template:cpp/experimental/scope guard/constructor

Creates a from a function, a function object or another.

@1@ Initializes the exit function with a function or function object. The constructed is active. @@ If is not an lvalue reference type and  is, the stored  is initialized with ; otherwise it is initialized with.

@@ . @@ The program is ill-formed if function call expression is ill-formed. @@ The behavior is undefined if calling  results in undefined behavior, even if  has not been called.

@2@ Move constructor. Initializes the stored with the one in. The constructed is active if and only if  is active before the construction. @@ If is, initializes stored  (denoted by ) with , otherwise initializes it with. @@ After successful move construction, is called and  becomes inactive. @@ . @@ The behavior is undefined if
 * is and  does not meet the requirements of, or
 * is and  does not meet the requirements of.

@3@ is not.

Exceptions
Any exception thrown during the initialization of the stored.

@1@ @2@