scc 2026.07
SystemC components library
Util::CallOnScopeExit< Lambda > Struct Template Reference

RAII for implementing DEFER behavior. More...

#include <defer.h>

Public Member Functions

constexpr CallOnScopeExit (Lambda initialLambda)
 Create RAII wrapper around Lambda.
 CallOnScopeExit (CallOnScopeExit &&other)
 Usually optimized away due to RVO.
 CallOnScopeExit (const CallOnScopeExit &other)=delete
CallOnScopeExitoperator= (const CallOnScopeExit &other)=delete
 ~CallOnScopeExit ()
 Actual lambda call once CallOnScopeExit goes out of scope.

Detailed Description

template<class Lambda>
struct Util::CallOnScopeExit< Lambda >

RAII for implementing DEFER behavior.

Definition at line 58 of file defer.h.

Constructor & Destructor Documentation

◆ CallOnScopeExit() [1/2]

template<class Lambda>
Util::CallOnScopeExit< Lambda >::CallOnScopeExit ( Lambda initialLambda)
inlineconstexpr

Create RAII wrapper around Lambda.

Using Lambda directly, optimizer takes case due to [&]() in front

Definition at line 61 of file defer.h.

◆ CallOnScopeExit() [2/2]

template<class Lambda>
Util::CallOnScopeExit< Lambda >::CallOnScopeExit ( CallOnScopeExit< Lambda > && other)
inline

Usually optimized away due to RVO.

Definition at line 66 of file defer.h.

◆ ~CallOnScopeExit()

template<class Lambda>
Util::CallOnScopeExit< Lambda >::~CallOnScopeExit ( )
inline

Actual lambda call once CallOnScopeExit goes out of scope.

Definition at line 77 of file defer.h.


The documentation for this struct was generated from the following file:
  • /home/eyck/Projects/MINRES/SystemC-Components/src/common/util/defer.h