VCV Rack API v2
Loading...
Searching...
No Matches
rack::DeferWrapper< F > Struct Template Reference

Defers running code until the scope is destructed. More...

#include <common.hpp>

Public Member Functions

 DeferWrapper (F f)
 
 ~DeferWrapper ()
 

Public Attributes

f
 

Detailed Description

template<typename F>
struct rack::DeferWrapper< F >

Defers running code until the scope is destructed.

From http://www.gingerbill.org/article/defer-in-cpp.html. Example:

file = fopen(...);
DEFER({
    fclose(file);
});

Constructor & Destructor Documentation

◆ DeferWrapper()

template<typename F >
rack::DeferWrapper< F >::DeferWrapper ( F f)
inline

◆ ~DeferWrapper()

template<typename F >
rack::DeferWrapper< F >::~DeferWrapper ( )
inline

Member Data Documentation

◆ f

template<typename F >
F rack::DeferWrapper< F >::f

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