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* ()
this
in order to write to the embedded ItemWrapper. (to alleviate, we'd have to re-link after copying/moving) Definition at line 410 of file wrapper.hpp.
Public Types | |
using | Res = typename _Fun< SIG >::Ret |
using | ResWrapper = ItemWrapper< Res > |
Public Member Functions | |
FunctionResult ()=default | |
by default locked to invalid state | |
template<typename FUN > | |
FunctionResult (FUN &&targetFunction) | |
Create result-remembering functor by outfitting a copy of the given function with an adaptor to capture each produced result. More... | |
Public Attributes | |
ResWrapper | lastResult_ |
Additional Inherited Members | |
Protected Member Functions inherited from NonCopyable | |
NonCopyable (NonCopyable const &)=delete | |
NonCopyable & | operator= (NonCopyable const &)=delete |
|
inline |
Create result-remembering functor by outfitting a copy of the given function with an adaptor to capture each produced result.
Definition at line 430 of file wrapper.hpp.