Home | History | Annotate | Download | only in bits

Lines Matching defs:unique_ptr

0 // unique_ptr implementation -*- C++ -*-
25 /** @file bits/unique_ptr.h
52 /// Primary template of default_delete, used by unique_ptr
127 /// 20.7.1.2 unique_ptr for single objects.
129 class unique_ptr
156 /// Default constructor, creates a unique_ptr that owns nothing.
157 constexpr unique_ptr() noexcept
169 unique_ptr(pointer __p) noexcept
181 unique_ptr(pointer __p,
193 unique_ptr(pointer __p,
199 /// Creates a unique_ptr that owns nothing.
200 constexpr unique_ptr(nullptr_t) noexcept : unique_ptr() { }
205 unique_ptr(unique_ptr&& __u) noexcept
215 is_convertible<typename unique_ptr<_Up, _Ep>::pointer, pointer>,
220 unique_ptr(unique_ptr<_Up, _Ep>&& __u) noexcept
228 unique_ptr(auto_ptr<_Up>&& __u) noexcept;
232 ~unique_ptr() noexcept
248 unique_ptr&
249 operator=(unique_ptr&& __u) noexcept
265 is_convertible<typename unique_ptr<_Up, _Ep>::pointer, pointer>,
268 unique_ptr&>::type
269 operator=(unique_ptr<_Up, _Ep>&& __u) noexcept
276 /// Reset the %unique_ptr to empty, invoking the deleter if necessary.
277 unique_ptr&
349 swap(unique_ptr& __u) noexcept
356 unique_ptr(const unique_ptr&) = delete;
357 unique_ptr& operator=(const unique_ptr&) = delete;
360 /// 20.7.1.3 unique_ptr for array objects with a runtime length
365 class unique_ptr<_Tp[], _Dp>
396 typename _Up_pointer = typename unique_ptr<_Up, _Ep>::pointer>
413 /// Default constructor, creates a unique_ptr that owns nothing.
414 constexpr unique_ptr() noexcept
426 unique_ptr(pointer __p) noexcept
435 unique_ptr(_Up* __p) = delete;
444 unique_ptr(pointer __p,
456 unique_ptr(pointer __p, typename
463 unique_ptr(unique_ptr&& __u) noexcept
466 /// Creates a unique_ptr that owns nothing.
467 constexpr unique_ptr(nullptr_t) noexcept : unique_ptr() { }
475 unique_ptr(unique_ptr<_Up, _Ep>&& __u) noexcept
480 ~unique_ptr()
496 unique_ptr&
497 operator=(unique_ptr&& __u) noexcept
513 enable_if<__safe_conversion<_Up, _Ep>::value, unique_ptr&>::type
514 operator=(unique_ptr<_Up, _Ep>&& __u) noexcept
521 /// Reset the %unique_ptr to empty, invoking the deleter if necessary.
522 unique_ptr&
591 swap(unique_ptr& __u) noexcept
598 unique_ptr(const unique_ptr&) = delete;
599 unique_ptr& operator=(const unique_ptr&) = delete;
604 unique_ptr(_Up*, typename
611 unique_ptr(_Up*, typename
617 swap(unique_ptr<_Tp, _Dp>& __x,
618 unique_ptr<_Tp, _Dp>& __y) noexcept
624 operator==(const unique_ptr<_Tp, _Dp>& __x,
625 const unique_ptr<_Up, _Ep>& __y)
630 operator==(const unique_ptr<_Tp, _Dp>& __x, nullptr_t) noexcept
635 operator==(nullptr_t, const unique_ptr<_Tp, _Dp>& __x) noexcept
641 operator!=(const unique_ptr<_Tp, _Dp>& __x,
642 const unique_ptr<_Up, _Ep>& __y)
647 operator!=(const unique_ptr<_Tp, _Dp>& __x, nullptr_t) noexcept
652 operator!=(nullptr_t, const unique_ptr<_Tp, _Dp>& __x) noexcept
658 operator<(const unique_ptr<_Tp, _Dp>& __x,
659 const unique_ptr<_Up, _Ep>& __y)
662 std::common_type<typename unique_ptr<_Tp, _Dp>::pointer,
663 typename unique_ptr<_Up, _Ep>::pointer>::type _CT;
669 operator<(const unique_ptr<_Tp, _Dp>& __x, nullptr_t)
670 { return std::less<typename unique_ptr<_Tp, _Dp>::pointer>()(__x.get(),
675 operator<(nullptr_t, const unique_ptr<_Tp, _Dp>& __x)
676 { return std::less<typename unique_ptr<_Tp, _Dp>::pointer>()(nullptr,
682 operator<=(const unique_ptr<_Tp, _Dp>& __x,
683 const unique_ptr<_Up, _Ep>& __y)
688 operator<=(const unique_ptr<_Tp, _Dp>& __x, nullptr_t)
693 operator<=(nullptr_t, const unique_ptr<_Tp, _Dp>& __x)
699 operator>(const unique_ptr<_Tp, _Dp>& __x,
700 const unique_ptr<_Up, _Ep>& __y)
705 operator>(const unique_ptr<_Tp, _Dp>& __x, nullptr_t)
706 { return std::less<typename unique_ptr<_Tp, _Dp>::pointer>()(nullptr,
711 operator>(nullptr_t, const unique_ptr<_Tp, _Dp>& __x)
712 { return std::less<typename unique_ptr<_Tp, _Dp>::pointer>()(__x.get(),
718 operator>=(const unique_ptr<_Tp, _Dp>& __x,
719 const unique_ptr<_Up, _Ep>& __y)
724 operator>=(const unique_ptr<_Tp, _Dp>& __x, nullptr_t)
729 operator>=(nullptr_t, const unique_ptr<_Tp, _Dp>& __x)
732 /// std::hash specialization for unique_ptr.
734 struct hash<unique_ptr<_Tp, _Dp>>
735 : public __hash_base<size_t, unique_ptr<_Tp, _Dp>>
738 operator()(const unique_ptr<_Tp, _Dp>& __u) const noexcept
740 typedef unique_ptr<_Tp, _Dp> _UP;
748 { typedef unique_ptr<_Tp> __single_object; };
752 { typedef unique_ptr<_Tp[]> __array; };
762 { return unique_ptr<_Tp>(new _Tp(std::forward<_Args>(__args)...)); }
768 { return unique_ptr<_Tp>(new typename remove_extent<_Tp>::type[__num]()); }