|
7997 | 7997 | memory to a function, and returning dynamically allocated memory from a
|
7998 | 7998 | function. \end{note}
|
7999 | 7999 |
|
8000 |
| -\begin{codeblock} |
8001 |
| -namespace std { |
8002 |
| - template<class T> struct default_delete; |
8003 |
| - template<class T> struct default_delete<T[]>; |
8004 |
| - |
8005 |
| - template<class T, class D = default_delete<T>> class unique_ptr; |
8006 |
| - template<class T, class D> class unique_ptr<T[], D>; |
8007 |
| - |
8008 |
| - template<class T, class... Args> unique_ptr<T> make_unique(Args&&... args); |
8009 |
| - template<class T> unique_ptr<T> make_unique(size_t n); |
8010 |
| - template<class T, class... Args> @\unspec@ make_unique(Args&&...) = delete; |
8011 |
| - |
8012 |
| - template<class T, class D> |
8013 |
| - void swap(unique_ptr<T, D>& x, unique_ptr<T, D>& y) noexcept; |
8014 |
| - |
8015 |
| - template<class T1, class D1, class T2, class D2> |
8016 |
| - bool operator==(const unique_ptr<T1, D1>& x, const unique_ptr<T2, D2>& y); |
8017 |
| - template<class T1, class D1, class T2, class D2> |
8018 |
| - bool operator!=(const unique_ptr<T1, D1>& x, const unique_ptr<T2, D2>& y); |
8019 |
| - template<class T1, class D1, class T2, class D2> |
8020 |
| - bool operator<(const unique_ptr<T1, D1>& x, const unique_ptr<T2, D2>& y); |
8021 |
| - template<class T1, class D1, class T2, class D2> |
8022 |
| - bool operator<=(const unique_ptr<T1, D1>& x, const unique_ptr<T2, D2>& y); |
8023 |
| - template<class T1, class D1, class T2, class D2> |
8024 |
| - bool operator>(const unique_ptr<T1, D1>& x, const unique_ptr<T2, D2>& y); |
8025 |
| - template<class T1, class D1, class T2, class D2> |
8026 |
| - bool operator>=(const unique_ptr<T1, D1>& x, const unique_ptr<T2, D2>& y); |
8027 |
| - |
8028 |
| - template <class T, class D> |
8029 |
| - bool operator==(const unique_ptr<T, D>& x, nullptr_t) noexcept; |
8030 |
| - template <class T, class D> |
8031 |
| - bool operator==(nullptr_t, const unique_ptr<T, D>& y) noexcept; |
8032 |
| - template <class T, class D> |
8033 |
| - bool operator!=(const unique_ptr<T, D>& x, nullptr_t) noexcept; |
8034 |
| - template <class T, class D> |
8035 |
| - bool operator!=(nullptr_t, const unique_ptr<T, D>& y) noexcept; |
8036 |
| - template <class T, class D> |
8037 |
| - bool operator<(const unique_ptr<T, D>& x, nullptr_t); |
8038 |
| - template <class T, class D> |
8039 |
| - bool operator<(nullptr_t, const unique_ptr<T, D>& y); |
8040 |
| - template <class T, class D> |
8041 |
| - bool operator<=(const unique_ptr<T, D>& x, nullptr_t); |
8042 |
| - template <class T, class D> |
8043 |
| - bool operator<=(nullptr_t, const unique_ptr<T, D>& y); |
8044 |
| - template <class T, class D> |
8045 |
| - bool operator>(const unique_ptr<T, D>& x, nullptr_t); |
8046 |
| - template <class T, class D> |
8047 |
| - bool operator>(nullptr_t, const unique_ptr<T, D>& y); |
8048 |
| - template <class T, class D> |
8049 |
| - bool operator>=(const unique_ptr<T, D>& x, nullptr_t); |
8050 |
| - template <class T, class D> |
8051 |
| - bool operator>=(nullptr_t, const unique_ptr<T, D>& y); |
8052 |
| -} |
8053 |
| -\end{codeblock} |
8054 |
| - |
8055 | 8000 | \rSec3[unique.ptr.dltr]{Default deleters}
|
8056 | 8001 |
|
8057 | 8002 | \rSec4[unique.ptr.dltr.general]{In general}
|
|
9186 | 9131 |
|
9187 | 9132 | template<class T> shared_ptr(weak_ptr<T>) -> shared_ptr<T>;
|
9188 | 9133 | template<class T, class D> shared_ptr(unique_ptr<T, D>) -> shared_ptr<T>;
|
9189 |
| - |
9190 |
| - // \ref{util.smartptr.shared.create}, \tcode{shared_ptr} creation |
9191 |
| - template<class T, class... Args> |
9192 |
| - shared_ptr<T> make_shared(Args&&... args); // \tcode{T} is not array |
9193 |
| - template<class T, class A, class... Args> |
9194 |
| - shared_ptr<T> allocate_shared(const A& a, Args&&... args); // \tcode{T} is not array |
9195 |
| - |
9196 |
| - template<class T> |
9197 |
| - shared_ptr<T> make_shared(size_t N); // \tcode{T} is \tcode{U[]} |
9198 |
| - template<class T, class A> |
9199 |
| - shared_ptr<T> allocate_shared(const A& a, size_t N); // \tcode{T} is \tcode{U[]} |
9200 |
| - |
9201 |
| - template<class T> |
9202 |
| - shared_ptr<T> make_shared(); // \tcode{T} is \tcode{U[N]} |
9203 |
| - template<class T, class A> |
9204 |
| - shared_ptr<T> allocate_shared(const A& a); // \tcode{T} is \tcode{U[N]} |
9205 |
| - |
9206 |
| - template<class T> |
9207 |
| - shared_ptr<T> make_shared(size_t N, const remove_extent_t<T>& u); // \tcode{T} is \tcode{U[]} |
9208 |
| - template<class T, class A> |
9209 |
| - shared_ptr<T> allocate_shared(const A& a, size_t N, |
9210 |
| - const remove_extent_t<T>& u); // \tcode{T} is \tcode{U[]} |
9211 |
| - |
9212 |
| - template<class T> shared_ptr<T> |
9213 |
| - make_shared(const remove_extent_t<T>& u); // \tcode{T} is \tcode{U[N]} |
9214 |
| - template<class T, class A> |
9215 |
| - shared_ptr<T> allocate_shared(const A& a, const remove_extent_t<T>& u); // \tcode{T} is \tcode{U[N]} |
9216 |
| - |
9217 |
| - // \ref{util.smartptr.shared.cmp}, \tcode{shared_ptr} comparisons |
9218 |
| - template<class T, class U> |
9219 |
| - bool operator==(const shared_ptr<T>& a, const shared_ptr<U>& b) noexcept; |
9220 |
| - template<class T, class U> |
9221 |
| - bool operator!=(const shared_ptr<T>& a, const shared_ptr<U>& b) noexcept; |
9222 |
| - template<class T, class U> |
9223 |
| - bool operator<(const shared_ptr<T>& a, const shared_ptr<U>& b) noexcept; |
9224 |
| - template<class T, class U> |
9225 |
| - bool operator>(const shared_ptr<T>& a, const shared_ptr<U>& b) noexcept; |
9226 |
| - template<class T, class U> |
9227 |
| - bool operator<=(const shared_ptr<T>& a, const shared_ptr<U>& b) noexcept; |
9228 |
| - template<class T, class U> |
9229 |
| - bool operator>=(const shared_ptr<T>& a, const shared_ptr<U>& b) noexcept; |
9230 |
| - |
9231 |
| - template <class T> |
9232 |
| - bool operator==(const shared_ptr<T>& a, nullptr_t) noexcept; |
9233 |
| - template <class T> |
9234 |
| - bool operator==(nullptr_t, const shared_ptr<T>& b) noexcept; |
9235 |
| - template <class T> |
9236 |
| - bool operator!=(const shared_ptr<T>& a, nullptr_t) noexcept; |
9237 |
| - template <class T> |
9238 |
| - bool operator!=(nullptr_t, const shared_ptr<T>& b) noexcept; |
9239 |
| - template <class T> |
9240 |
| - bool operator<(const shared_ptr<T>& a, nullptr_t) noexcept; |
9241 |
| - template <class T> |
9242 |
| - bool operator<(nullptr_t, const shared_ptr<T>& b) noexcept; |
9243 |
| - template <class T> |
9244 |
| - bool operator<=(const shared_ptr<T>& a, nullptr_t) noexcept; |
9245 |
| - template <class T> |
9246 |
| - bool operator<=(nullptr_t, const shared_ptr<T>& b) noexcept; |
9247 |
| - template <class T> |
9248 |
| - bool operator>(const shared_ptr<T>& a, nullptr_t) noexcept; |
9249 |
| - template <class T> |
9250 |
| - bool operator>(nullptr_t, const shared_ptr<T>& b) noexcept; |
9251 |
| - template <class T> |
9252 |
| - bool operator>=(const shared_ptr<T>& a, nullptr_t) noexcept; |
9253 |
| - template <class T> |
9254 |
| - bool operator>=(nullptr_t, const shared_ptr<T>& b) noexcept; |
9255 |
| - |
9256 |
| - // \ref{util.smartptr.shared.spec}, \tcode{shared_ptr} specialized algorithms |
9257 |
| - template<class T> |
9258 |
| - void swap(shared_ptr<T>& a, shared_ptr<T>& b) noexcept; |
9259 |
| - |
9260 |
| - // \ref{util.smartptr.shared.cast}, \tcode{shared_ptr} casts |
9261 |
| - template<class T, class U> |
9262 |
| - shared_ptr<T> static_pointer_cast(const shared_ptr<U>& r) noexcept; |
9263 |
| - template<class T, class U> |
9264 |
| - shared_ptr<T> dynamic_pointer_cast(const shared_ptr<U>& r) noexcept; |
9265 |
| - template<class T, class U> |
9266 |
| - shared_ptr<T> const_pointer_cast(const shared_ptr<U>& r) noexcept; |
9267 |
| - template<class T, class U> |
9268 |
| - shared_ptr<T> reinterpret_pointer_cast(const shared_ptr<U>& r) noexcept; |
9269 |
| - |
9270 |
| - // \ref{util.smartptr.getdeleter}, \tcode{shared_ptr} \tcode{get_deleter} |
9271 |
| - template<class D, class T> |
9272 |
| - D* get_deleter(const shared_ptr<T>& p) noexcept; |
9273 |
| - |
9274 |
| - // \ref{util.smartptr.shared.io}, \tcode{shared_ptr} I/O |
9275 |
| - template<class E, class T, class Y> |
9276 |
| - basic_ostream<E, T>& operator<< (basic_ostream<E, T>& os, const shared_ptr<Y>& p); |
9277 | 9134 | }
|
9278 | 9135 | \end{codeblock}
|
9279 | 9136 |
|
|
0 commit comments