Lumiera
0.pre.03
»edit your freedom«
|
#include "lib/wrapper.hpp"
Extension of ItemWrapper: a function remembering the result of the last invocation.
Initially, the "value" is bottom (undefined, NIL), until the function is invoked for the first time. After that, the result of the last invocation can be accessed by operator* ()
Definition at line 410 of file wrapper.hpp.
Public Member Functions | |
FunctionResult () | |
default ctor yields an object locked to invalid state | |
template<typename FUN > | |
FunctionResult (FUN targetFunction) | |
Create result-remembering functor by binding the given function. More... | |
bool | isValid () const |
operator bool () const | |
Res & | operator* () const |
Private Types | |
using | Res = typename _Fun< SIG >::Ret |
using | ResWrapper = ItemWrapper< Res > |
Private Member Functions | |
Res | captureResult (Res res) |
Private Member Functions inherited from NonCopyable | |
NonCopyable (NonCopyable const &)=delete | |
NonCopyable & | operator= (NonCopyable const &)=delete |
Private Attributes | |
ResWrapper | lastResult_ |
|
inline |
Create result-remembering functor by binding the given function.
Explanation:
*this
is a functionDefinition at line 443 of file wrapper.hpp.