25 constexpr ~Deferred() noexcept(std::is_nothrow_invocable_v<F>)
34 :
_f(std::forward<F>(f))
47 [[nodiscard(
"The value returned from defer() must not be discarded. Discarding it calls the function passed to defer() right away.")]]
Helper class that is created by a call to.
constexpr ~Deferred() noexcept(std::is_nothrow_invocable_v< F >)
Calls the deferred function.
constexpr Deferred(F &&f)
The construtor is private, an can only be called from defer().
Deferred(Deferred< F > &&)=delete
Deferred & operator=(Deferred< F > const &)=delete
friend constexpr Deferred< N > defer(N &&f) noexcept
Allow Deferred to be constructed from defer().
Deferred & operator=(Deferred< F > &&)=delete
Deferred(Deferred< F > const &)=delete
constexpr Deferred< F > defer(F &&f) noexcept