@@ -89,8 +89,9 using default_copier_t = typename default_copier<T>::type; | |||||
89 |
|
89 | |||
90 | template <class T, class D, class C> |
|
90 | template <class T, class D, class C> | |
91 | struct is_default_manageable |
|
91 | struct is_default_manageable | |
92 |
: public std::integral_constant<bool, |
|
92 | : public std::integral_constant<bool, | |
93 |
|
|
93 | std::is_same<D, default_deleter_t<T> >::value | |
|
94 | && std::is_same<C, default_copier_t<T> >::value> { | |||
94 | }; |
|
95 | }; | |
95 | } |
|
96 | } | |
96 |
|
97 | |||
@@ -131,10 +132,11 public: | |||||
131 | } |
|
132 | } | |
132 |
|
133 | |||
133 | template <class U> |
|
134 | template <class U> | |
134 | impl_ptr(U *u, typename std::enable_if<std::is_convertible<U *, pointer>::value |
|
135 | impl_ptr(U *u, | |
135 | && is_default_manageable::value, |
|
136 | typename std::enable_if<std::is_convertible<U *, pointer>::value | |
136 |
|
|
137 | && is_default_manageable::value, | |
137 | = dummy_t_()) SPIMPL_NOEXCEPT |
|
138 | dummy_t_>::type | |
|
139 | = dummy_t_()) SPIMPL_NOEXCEPT | |||
138 | : impl_ptr(u, &details::default_delete<T>, &details::default_copy<T>) |
|
140 | : impl_ptr(u, &details::default_delete<T>, &details::default_copy<T>) | |
139 | { |
|
141 | { | |
140 | } |
|
142 | } | |
@@ -151,12 +153,12 public: | |||||
151 |
|
153 | |||
152 | #ifdef SPIMPL_HAS_AUTO_PTR |
|
154 | #ifdef SPIMPL_HAS_AUTO_PTR | |
153 | template <class U> |
|
155 | template <class U> | |
154 | impl_ptr(std::auto_ptr<U> &&u, typename std::enable_if<std::is_convertible<U *, pointer>::value |
|
156 | impl_ptr(std::auto_ptr<U> &&u, | |
155 | && is_default_manageable::value, |
|
157 | typename std::enable_if<std::is_convertible<U *, pointer>::value | |
156 |
|
|
158 | && is_default_manageable::value, | |
157 |
|
|
159 | dummy_t_>::type | |
158 | : ptr_(u.release(), &details::default_delete<T>), |
|
160 | = dummy_t_()) SPIMPL_NOEXCEPT : ptr_(u.release(), &details::default_delete<T>), | |
159 | copier_(&details::default_copy<T>) |
|
161 | copier_(&details::default_copy<T>) | |
160 | { |
|
162 | { | |
161 | } |
|
163 | } | |
162 | #endif |
|
164 | #endif | |
@@ -238,8 +240,9 public: | |||||
238 |
|
240 | |||
239 | #ifdef SPIMPL_HAS_AUTO_PTR |
|
241 | #ifdef SPIMPL_HAS_AUTO_PTR | |
240 | template <class U> |
|
242 | template <class U> | |
241 | typename std::enable_if< |
|
243 | typename std::enable_if<std::is_convertible<U *, pointer>::value | |
242 | std::is_convertible<U *, pointer>::value && is_default_manageable::value, impl_ptr &>::type |
|
244 | && is_default_manageable::value, | |
|
245 | impl_ptr &>::type | |||
243 | operator=(std::auto_ptr<U> &&u) SPIMPL_NOEXCEPT |
|
246 | operator=(std::auto_ptr<U> &&u) SPIMPL_NOEXCEPT | |
244 | { |
|
247 | { | |
245 | return operator=(impl_ptr(std::move(u))); |
|
248 | return operator=(impl_ptr(std::move(u))); | |
@@ -247,8 +250,9 public: | |||||
247 | #endif |
|
250 | #endif | |
248 |
|
251 | |||
249 | template <class U> |
|
252 | template <class U> | |
250 | typename std::enable_if< |
|
253 | typename std::enable_if<std::is_convertible<U *, pointer>::value | |
251 | std::is_convertible<U *, pointer>::value && is_default_manageable::value, impl_ptr &>::type |
|
254 | && is_default_manageable::value, | |
|
255 | impl_ptr &>::type | |||
252 | operator=(std::unique_ptr<U> &&u) SPIMPL_NOEXCEPT |
|
256 | operator=(std::unique_ptr<U> &&u) SPIMPL_NOEXCEPT | |
253 | { |
|
257 | { | |
254 | return operator=(impl_ptr(std::move(u))); |
|
258 | return operator=(impl_ptr(std::move(u))); |
General Comments 0
You need to be logged in to leave comments.
Login now