Krita Source Code Documentation
Loading...
Searching...
No Matches
kismpl::finally< F > Struct Template Reference

#include <KisMpl.h>

Public Member Functions

 finally (const finally &)=delete
 
 finally (F &&f)
 
 finally (finally &&)=delete
 
 ~finally ()
 

Private Attributes

m_f
 

Detailed Description

template<typename F>
struct kismpl::finally< F >

A simple wrapper class that executes a passed lambda on destruction. It might be used for cleaning-up resources, which are not a part of normal RAII relationships.

Definition at line 589 of file KisMpl.h.

Constructor & Destructor Documentation

◆ finally() [1/3]

template<typename F >
kismpl::finally< F >::finally ( F && f)
inline

Definition at line 590 of file KisMpl.h.

591 : m_f(std::forward<F>(f))
592 {
593 }

◆ finally() [2/3]

template<typename F >
kismpl::finally< F >::finally ( const finally< F > & )
delete

◆ finally() [3/3]

template<typename F >
kismpl::finally< F >::finally ( finally< F > && )
delete

◆ ~finally()

template<typename F >
kismpl::finally< F >::~finally ( )
inline

Definition at line 598 of file KisMpl.h.

598 {
599 m_f();
600 }

References kismpl::finally< F >::m_f.

Member Data Documentation

◆ m_f

template<typename F >
F kismpl::finally< F >::m_f
private

Definition at line 602 of file KisMpl.h.


The documentation for this struct was generated from the following file: