60 using lumiera::error::LERR_(BOTTOM_VALUE);
77 T& operator() ()
const {
return ref_;}
82 refFunction (T& target)
109 template<
typename TY>
113 using TY_unconst = std::remove_const_t<TY>;
117 char content_[
sizeof(TY)];
120 template<
typename REF>
124 new(&content_) TY{std::forward<REF> (ref)};
131 if (created_) access().~TY();
138 return reinterpret_cast<TY&
> (content_);
144 return const_cast<TY_unconst&
> (access());
162 build (std::move(ro));
184 build (std::move (*rref));
195 this->operator= (*cref);
211 this->operator= (std::move(*rref));
228 operator= (X&& something)
230 if (!isSameObject (something, access() ))
233 build (std::forward<X>(something));
247 operator bool()
const 259 , LERR_(BOTTOM_VALUE));
288 template<
typename TY>
307 operator bool()
const {
return isValid(); }
312 operator= (TY& otherRef)
314 content_ = &otherRef;
332 , LERR_(BOTTOM_VALUE));
339 return bool(content_);
364 operator bool()
const {
return true; }
365 bool isValid ()
const {
return true; }
381 template<
typename TY>
386 || ( w1 && w2 && (*w1)==(*w2));
388 template<
typename TY>
392 return not (w1 == w2);
409 template<
typename SIG>
411 :
public function<SIG>
421 captureResult (Res res)
442 template<
typename FUN>
446 using std::placeholders::_1;
447 using lib::meta::func::chained;
449 function<Res(Res)> doCaptureResult = bind (&FunctionResult::captureResult,
this, _1 );
450 function<SIG> chainedWithResCapture = chained (targetFunction, doCaptureResult);
452 function<SIG>::operator= (chainedWithResCapture);
456 Res& operator*()
const {
return *lastResult_; }
457 bool isValid ()
const {
return lastResult_.isValid(); }
460 operator bool()
const {
return isValid(); }
Reference wrapper implemented as constant function, returning the (fixed) reference on invocation...
FunctionResult()
default ctor yields an object locked to invalid state
TY_unconst & access_unconst() const
< used to assign new buffer contents
Extension of ItemWrapper: a function remembering the result of the last invocation.
Any copy and copy construction prohibited.
bool operator==(PtrDerefIter< I1 > const &il, PtrDerefIter< I2 > const &ir)
Supporting equality comparisons...
Partial function application and building a complete function closure.
Universal value/ref wrapper accessible similar to a pointer.
Implementation namespace for support and library code.
ItemWrapper & defaultInit()
implant a default-initialised instance of the payload type
Derived specific exceptions within Lumiera's exception hierarchy.
Mix-Ins to allow or prohibit various degrees of copying and cloning.
Metaprogramming tools for transforming functor types.
Tiny helper functions and shortcuts to be used everywhere Consider this header to be effectively incl...
Lumiera error handling (C++ interface).
FunctionResult(FUN targetFunction)
Create result-remembering functor by binding the given function.
bool isSameObject(A const &a, B const &b)
compare plain object identity, bypassing any custom comparison operators.