23 #ifndef LIB_SCOPEDHOLDER_TRANSFER_H 24 #define LIB_SCOPEDHOLDER_TRANSFER_H 67 template<
class TY,
class PAR = std::allocator<TY>>
76 typedef typename PAR::size_type size_type;
77 typedef typename PAR::difference_type difference_type;
78 typedef typename PAR::pointer pointer;
79 typedef typename PAR::const_pointer const_pointer;
80 typedef typename PAR::reference reference;
81 typedef typename PAR::const_reference const_reference;
82 typedef typename PAR::value_type value_type;
103 size_type max_size()
const {
return par_.max_size(); }
104 pointer address(reference r)
const {
return par_.address(r); }
105 const_pointer address(const_reference cr)
const {
return par_.address(cr); }
106 pointer allocate(size_type n,
const void *p=0){
return par_.allocate(n,p); }
107 void deallocate(pointer p, size_type n) { par_.deallocate(p,n); }
108 void destroy(pointer p) { par_.destroy(p); }
112 construct (pointer p,
const TY& ref)
116 ASSERT (!(*p),
"protocol violation: target already manages another object.");
118 transfer_control (const_cast<TY&>(ref), *p);
122 template<
typename TY1,
typename TY2,
class ALO>
127 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).