58 #ifndef LIB_SCOPED_HOLDER_H 59 #define LIB_SCOPED_HOLDER_H 78 :
public std::unique_ptr<B>
80 typedef std::unique_ptr<B> _Parent;
82 static B* must_be_null (_Parent
const& ptr)
86 "attempt to copy from non-null.");
102 : _Parent(pu.release())
106 : _Parent(must_be_null (ref))
112 must_be_null (*
this);
121 TRACE (
test,
"transfer_control<ScopedPtrHolder>... from=%p to=%p",&from, &to);
146 char content_[
sizeof(TY)];
155 "copy operation after having invoked create().");
171 TY * obj =
new(content_) TY();
180 TY * obj =
new(content_) TY(o);
195 : created_(must_be_empty (ref))
201 must_be_empty (*
this);
211 return (TY&) content_;
218 return (TY*) &content_;
223 return (TY*) &content_;
228 explicit operator bool()
const {
return created_; }
229 bool operator! ()
const {
return not created_; }
236 TRACE (
test,
"transfer_control<ScopedHolder>... from=%p to=%p",&from, &to);
241 transfer_control(*from,*to);
248 WARN (
test,
"transfer_control operation aborted.");
Implementation namespace for support and library code.
Derived specific exceptions within Lumiera's exception hierarchy.
Inline buffer holding and owning an object similar to unique_ptr.
Lumiera error handling (C++ interface).
Extension to std::unique_ptr, allowing copy operations on empty pointers (i.e.