OSVR-Core
Public Member Functions | List of all members
osvr::util::FinalTask< F > Class Template Reference

Allows you to run a callable something at the end of a scope. More...

#include <Finally.h>

Public Member Functions

 FinalTask (F f)
 Explicit constructor from something callable.
 
 FinalTask (FinalTask &&other)
 Move constructor - cancels the moved-from task.
 
 FinalTask (FinalTask const &)=delete
 non-copyable
 
FinalTaskoperator= (FinalTask const &)=delete
 non-assignable
 
 ~FinalTask ()
 Destructor - if we haven't been cancelled, do our callable thing.
 
void cancel ()
 Cancel causes us to not do our final task on destruction.
 

Detailed Description

template<typename F>
class osvr::util::FinalTask< F >

Allows you to run a callable something at the end of a scope.

The class that provides the scope-guard behavior. Often not referred to by name because auto is useful here, and often not created by a direct constructor call because of the finally() convenience functions combined with lambdas.


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