48 #ifndef LIB_SCOPED_HOLDER_H 49 #define LIB_SCOPED_HOLDER_H 68 :
public std::unique_ptr<B>
70 typedef std::unique_ptr<B> _Parent;
72 static B* must_be_null (_Parent
const& ptr)
76 "attempt to copy from non-null.");
92 : _Parent(pu.release())
96 : _Parent(must_be_null (ref))
102 must_be_null (*
this);
111 TRACE (
test,
"transfer_control<ScopedPtrHolder>... from=%p to=%p",&from, &to);
136 char content_[
sizeof(TY)];
145 "copy operation after having invoked create().");
161 TY * obj =
new(content_) TY();
170 TY * obj =
new(content_) TY(o);
185 : created_(must_be_empty (ref))
191 must_be_empty (*
this);
201 return (TY&) content_;
208 return (TY*) &content_;
213 return (TY*) &content_;
218 explicit operator bool()
const {
return created_; }
219 bool operator! ()
const {
return not created_; }
226 TRACE (
test,
"transfer_control<ScopedHolder>... from=%p to=%p",&from, &to);
231 transfer_control(*from,*to);
238 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.