29 SMART
const &smart()
const noexcept {
return *
this; }
31 void _delete()
noexcept
36 Cap<T> release()
const noexcept
61 template<
typename O >
65 template<
typename O >
70 template<
typename O >
71 Smart_cap(Smart_cap<O, SMART>
const &o) noexcept
72 :
Cap_base(SMART::copy(o)), SMART(o.smart())
73 { Cap<T>::template check_convertible_from<O>(); }
75 Smart_cap(Smart_cap
const &o) noexcept
76 :
Cap_base(SMART::copy(o)), SMART(o.smart())
79 template<
typename O >
81 { Cap<T>::template check_convertible_from<O>(); }
89 template<
typename O >
90 void operator = (Smart_cap<O, SMART>
const &o)
noexcept
93 _c = this->SMART::copy(o).cap();
94 this->SMART::operator = (o.smart());
98 Smart_cap
const &operator = (Smart_cap
const &o)
noexcept
104 _c = this->SMART::copy(o).cap();
105 this->SMART::operator = (o.smart());
109#if __cplusplus >= 201103L
110 template<
typename O >
111 Smart_cap(Smart_cap<O, SMART> &&o) noexcept
112 :
Cap_base(o.release()), SMART(o.smart())
113 { Cap<T>::template check_convertible_from<O>(); }
115 Smart_cap(Smart_cap &&o) noexcept
116 :
Cap_base(o.release()), SMART(o.smart())
119 template<
typename O >
120 void operator = (Smart_cap<O, SMART> &&o)
noexcept
123 _c = o.release().cap();
124 this->SMART::operator = (o.smart());
128 Smart_cap
const &operator = (Smart_cap &&o)
noexcept
134 _c = o.release().cap();
135 this->SMART::operator = (o.smart());
147 ~Smart_cap() noexcept { _delete(); }