Created by: bcaimano
This commit adds three new functions to kj::_:Deferred
:
- A move-assignment operator to allow reuse of the same variable for deferred functors of the same type.
- A
run()
function to immediately run the guard before destruction. - A
nullptr
assignment operator (nullification) as syntactic sugar forrun()
.
It's worth mentioning that via the magic of kj::Maybe and universal references, Deferred
maintains the ability to hold lvalue reference to functors instead of functor instances.