FunctionRef
AppCUI::Utils::FunctionRef (class)
-
template<typename Fn>
class FunctionRef Non-owning, non-allocating reference to a callable (a light
std::functionfor callbacks that do not outlive the call).Example:
void f(FunctionRef<bool(int)> pred) { pred(6); } int x = 5; auto pred = [&x](int arg) { x = arg + 1; return x + arg == 10; }; f(pred);