A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from https://en.cppreference.com/w/cpp/experimental/scope_fail/scope_fail.html below:

std::experimental::scope_fail<EF>::scope_fail - cppreference.com

template< class Fn >
explicit scope_fail( Fn&& fn ) noexcept(/*see below*/);

(1) (library fundamentals TS v3)

scope_fail( scope_fail&& other ) noexcept(/*see below*/);

(2) (library fundamentals TS v3)

scope_fail( const scope_fail& ) = delete;

(3) (library fundamentals TS v3)

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

1)

Initializes the exit function with a function or function object, and initializes the counter of uncaught exceptions as if with

std::uncaught_exceptions()

. The constructed

scope_fail

is active.

If initialization of the stored EF throws an exception, calls fn().

The program is ill-formed if function call expression fn() is ill-formed.

The behavior is undefined if calling fn() throws an exception or results in undefined behavior, even if fn has not been called.

2) Move constructor. Initializes the stored EF with the one in other, and initializes the counter of uncaught exceptions with the one in other. The constructed scope_fail is active if and only if other is active before the construction.

After successful move construction, other.release() is called and other becomes inactive.

[edit] Parameters fn - function or function object used for initializing the stored EF other - scope_fail to move from [edit] Exceptions

Any exception thrown during the initialization of the stored EF.

[edit] Example [edit] See also

RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4