WPILibC++ 2027.0.0-alpha-4
Loading...
Searching...
No Matches
slp::scope_exit< F > Class Template Reference

scope_exit is a general-purpose scope guard intended to call its exit function when a scope is exited. More...

#include </home/runner/work/allwpilib/allwpilib/wpimath/src/main/native/thirdparty/sleipnir/include/sleipnir/util/scope_exit.hpp>

Public Member Functions

 scope_exit (F &&f) noexcept
 Constructs a scope_exit.
 ~scope_exit ()
 scope_exit (scope_exit &&rhs) noexcept
 Move constructor.
 scope_exit (const scope_exit &)=delete
scope_exitoperator= (const scope_exit &)=delete
void release () noexcept
 Makes the scope_exit inactive.

Detailed Description

template<typename F>
class slp::scope_exit< F >

scope_exit is a general-purpose scope guard intended to call its exit function when a scope is exited.

Template Parameters
FFunction type.

Constructor & Destructor Documentation

◆ scope_exit() [1/3]

template<typename F>
slp::scope_exit< F >::scope_exit ( F && f)
inlineexplicitnoexcept

Constructs a scope_exit.

Parameters
fFunction to call on scope exit.

◆ ~scope_exit()

template<typename F>
slp::scope_exit< F >::~scope_exit ( )
inline

◆ scope_exit() [2/3]

template<typename F>
slp::scope_exit< F >::scope_exit ( scope_exit< F > && rhs)
inlinenoexcept

Move constructor.

Parameters
rhsscope_exit from which to move.

◆ scope_exit() [3/3]

template<typename F>
slp::scope_exit< F >::scope_exit ( const scope_exit< F > & )
delete

Member Function Documentation

◆ operator=()

template<typename F>
scope_exit & slp::scope_exit< F >::operator= ( const scope_exit< F > & )
delete

◆ release()

template<typename F>
void slp::scope_exit< F >::release ( )
inlinenoexcept

Makes the scope_exit inactive.


The documentation for this class was generated from the following file:
  • /home/runner/work/allwpilib/allwpilib/wpimath/src/main/native/thirdparty/sleipnir/include/sleipnir/util/scope_exit.hpp