HikoGUI
A low latency retained GUI
Loading...
Searching...
No Matches
hi::v1::defer Class Reference

#include <hikogui/utility/defer.hpp>

Public Member Functions

 defer (defer &&)=delete
 defer (defer const &)=delete
defer & operator= (defer &&)=delete
defer & operator= (defer const &)=delete
template<std::invocable<> Func>
 defer (Func &&func) noexcept
void cancel () noexcept

Detailed Description

Defer execution of a lambda to the end of the scope.

c++ guarantees the destruction of local objects in a compound statement (block) at the closing brace, in reverse order of declaration. This means that multiple defer instances will call their lambdas in reverse order of declaration as well.


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