32 #ifndef LIB_SCOPEDHOLDER_TRANSFER_H 33 #define LIB_SCOPEDHOLDER_TRANSFER_H 76 template<
class TY,
class PAR = std::allocator<TY>>
85 typedef typename PAR::size_type size_type;
86 typedef typename PAR::difference_type difference_type;
87 typedef typename PAR::pointer pointer;
88 typedef typename PAR::const_pointer const_pointer;
89 typedef typename PAR::reference reference;
90 typedef typename PAR::const_reference const_reference;
91 typedef typename PAR::value_type value_type;
100 : par_(allo.par_) { }
112 size_type max_size()
const {
return par_.max_size(); }
113 pointer address(reference r)
const {
return par_.address(r); }
114 const_pointer address(const_reference cr)
const {
return par_.address(cr); }
115 pointer allocate(size_type n,
const void *p=0){
return par_.allocate(n,p); }
116 void deallocate(pointer p, size_type n) { par_.deallocate(p,n); }
117 void destroy(pointer p) { par_.destroy(p); }
121 construct (pointer p,
const TY& ref)
125 ASSERT (!(*p),
"protocol violation: target already manages another object.");
127 transfer_control (const_cast<TY&>(ref), *p);
131 template<
typename TY1,
typename TY2,
class ALO>
136 template<
typename TY1,
typename TY2,
class ALO>
bool operator==(PtrDerefIter< I1 > const &il, PtrDerefIter< I2 > const &ir)
Supporting equality comparisons...
Implementation namespace for support and library code.
Addendum to scoped-holder.hpp for transferring the lifecycle management to another instance...
Lumiera error handling (C++ interface).