40 SMART
const &smart()
const noexcept {
return *
this; }
42 void _delete()
noexcept
47 Cap<T> release()
const noexcept
72 template<
typename O >
76 template<
typename O >
81 template<
typename O >
82 Smart_cap(Smart_cap<O, SMART>
const &o) noexcept
83 :
Cap_base(SMART::copy(o)), SMART(o.smart())
84 { Cap<T>::template check_convertible_from<O>(); }
86 Smart_cap(Smart_cap
const &o) noexcept
87 :
Cap_base(SMART::copy(o)), SMART(o.smart())
90 template<
typename O >
92 { Cap<T>::template check_convertible_from<O>(); }
100 template<
typename O >
101 void operator = (Smart_cap<O, SMART>
const &o)
noexcept
104 _c = this->SMART::copy(o).cap();
105 this->SMART::operator = (o.smart());
109 Smart_cap
const &operator = (Smart_cap
const &o)
noexcept
115 _c = this->SMART::copy(o).cap();
116 this->SMART::operator = (o.smart());
120#if __cplusplus >= 201103L
121 template<
typename O >
122 Smart_cap(Smart_cap<O, SMART> &&o) noexcept
123 :
Cap_base(o.release()), SMART(o.smart())
124 { Cap<T>::template check_convertible_from<O>(); }
126 Smart_cap(Smart_cap &&o) noexcept
127 :
Cap_base(o.release()), SMART(o.smart())
130 template<
typename O >
131 void operator = (Smart_cap<O, SMART> &&o)
noexcept
134 _c = o.release().cap();
135 this->SMART::operator = (o.smart());
139 Smart_cap
const &operator = (Smart_cap &&o)
noexcept
145 _c = o.release().cap();
146 this->SMART::operator = (o.smart());
158 ~Smart_cap() noexcept { _delete(); }