52 using LERR_(BOTTOM_VALUE);
69 T& operator() ()
const {
return ref_;}
74 refFunction (T& target)
101 template<
typename TY>
105 using TY_unconst = std::remove_const_t<TY>;
109 std::byte content_[
sizeof(TY)];
113 template<
typename REF>
117 new(&content_) TY{std::forward<REF> (ref)};
124 if (created_) access().~TY();
131 return * std::launder (reinterpret_cast<TY*> (&content_));
137 return const_cast<TY_unconst&
> (access());
155 build (std::move(ro));
177 build (std::move (*rref));
188 this->operator= (*cref);
204 this->operator= (std::move(*rref));
221 operator= (X&& something)
223 if (!isSameObject (something, access() ))
226 build (std::forward<X>(something));
240 operator bool()
const 252 , LERR_(BOTTOM_VALUE));
281 template<
typename TY>
300 operator bool()
const {
return isValid(); }
305 operator= (TY& otherRef)
307 content_ = &otherRef;
325 , LERR_(BOTTOM_VALUE));
332 return bool(content_);
357 operator bool()
const {
return true; }
358 bool isValid ()
const {
return true; }
374 template<
typename TY>
379 || ( w1 && w2 && (*w1)==(*w2));
381 template<
typename TY>
385 return not (w1 == w2);
400 template<
typename SIG>
402 :
public function<SIG>
420 template<
typename FUN>
422 : function<SIG>{lib::meta::func::chained
423 ( std::forward<FUN> (targetFunction)
424 , [
this](Res res) -> Res
427 return std::forward<Res> (res);
432 Res& operator*()
const {
return *lastResult_; }
433 bool isValid ()
const {
return lastResult_.isValid(); }
436 operator bool()
const {
return isValid(); }
Reference wrapper implemented as constant function, returning the (fixed) reference on invocation...
TY_unconst & access_unconst() const
< used to assign new buffer contents
Any copy and copy construction prohibited.
FunctionResult(FUN &&targetFunction)
Create result-remembering functor by outfitting a copy of the given function with an adaptor to captu...
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...
Extension of ItemWrapper: a function remembering the result of the last invocation.
Lumiera error handling (C++ interface).
bool isSameObject(A const &a, B const &b)
compare plain object identity, based directly on the referee's memory identities. ...