Constructors

Synopses

Declared in <bdlb_scopeexit.h>

Move‐construct from original and release the moved‐from object.

ScopeExit(bslmf::MovableRef<ScopeExit> original) noexcept(/* see-below */);

Create a ScopeExit that will invoke function on destruction.

explicit
ScopeExit(void(* function)());

Create a ScopeExit that will invoke function on destruction.

template<class EXIT_FUNC_PARAM>
explicit
ScopeExit(EXIT_FUNC_PARAM&& function)
requires bsl::is_constructible<  // Copy construct
            EXIT_FUNC,
            const typename MoveUtil::Decay<EXIT_FUNC_PARAM>::type&
        >::value                                                             ||
        bsl::is_constructible<  // Move construct
            EXIT_FUNC,
            bslmf::MovableRef<typename MoveUtil::Decay<EXIT_FUNC_PARAM>::type>
        >::value;

Parameters

Name

Description

original

scope exit object to move from

function

function pointer invoked on destruction unless release is called

Created with MrDocs