Lines Matching refs:shared_ptr
388 class shared_ptr
395 constexpr shared_ptr() noexcept;
396 template<class Y> explicit shared_ptr(Y* p);
397 template<class Y, class D> shared_ptr(Y* p, D d);
398 template<class Y, class D, class A> shared_ptr(Y* p, D d, A a);
399 template <class D> shared_ptr(nullptr_t p, D d);
400 template <class D, class A> shared_ptr(nullptr_t p, D d, A a);
401 template<class Y> shared_ptr(const shared_ptr<Y>& r, T *p) noexcept;
402 shared_ptr(const shared_ptr& r) noexcept;
403 template<class Y> shared_ptr(const shared_ptr<Y>& r) noexcept;
404 shared_ptr(shared_ptr&& r) noexcept;
405 template<class Y> shared_ptr(shared_ptr<Y>&& r) noexcept;
406 template<class Y> explicit shared_ptr(const weak_ptr<Y>& r);
407 template<class Y> shared_ptr(auto_ptr<Y>&& r); // removed in C++17
408 template <class Y, class D> shared_ptr(unique_ptr<Y, D>&& r);
409 shared_ptr(nullptr_t) : shared_ptr() { }
412 ~shared_ptr();
415 shared_ptr& operator=(const shared_ptr& r) noexcept;
416 template<class Y> shared_ptr& operator=(const shared_ptr<Y>& r) noexcept;
417 shared_ptr& operator=(shared_ptr&& r) noexcept;
418 template<class Y> shared_ptr& operator=(shared_ptr<Y>&& r);
419 template<class Y> shared_ptr& operator=(auto_ptr<Y>&& r); // removed in C++17
420 template <class Y, class D> shared_ptr& operator=(unique_ptr<Y, D>&& r);
423 void swap(shared_ptr& r) noexcept;
436 template<class U> bool owner_before(shared_ptr<U> const& b) const;
440 // shared_ptr comparisons:
442 bool operator==(shared_ptr<T> const& a, shared_ptr<U> const& b) noexcept;
444 bool operator!=(shared_ptr<T> const& a, shared_ptr<U> const& b) noexcept;
446 bool operator<(shared_ptr<T> const& a, shared_ptr<U> const& b) noexcept;
448 bool operator>(shared_ptr<T> const& a, shared_ptr<U> const& b) noexcept;
450 bool operator<=(shared_ptr<T> const& a, shared_ptr<U> const& b) noexcept;
452 bool operator>=(shared_ptr<T> const& a, shared_ptr<U> const& b) noexcept;
455 bool operator==(const shared_ptr<T>& x, nullptr_t) noexcept;
457 bool operator==(nullptr_t, const shared_ptr<T>& y) noexcept;
459 bool operator!=(const shared_ptr<T>& x, nullptr_t) noexcept;
461 bool operator!=(nullptr_t, const shared_ptr<T>& y) noexcept;
463 bool operator<(const shared_ptr<T>& x, nullptr_t) noexcept;
465 bool operator<(nullptr_t, const shared_ptr<T>& y) noexcept;
467 bool operator<=(const shared_ptr<T>& x, nullptr_t) noexcept;
469 bool operator<=(nullptr_t, const shared_ptr<T>& y) noexcept;
471 bool operator>(const shared_ptr<T>& x, nullptr_t) noexcept;
473 bool operator>(nullptr_t, const shared_ptr<T>& y) noexcept;
475 bool operator>=(const shared_ptr<T>& x, nullptr_t) noexcept;
477 bool operator>=(nullptr_t, const shared_ptr<T>& y) noexcept;
479 // shared_ptr specialized algorithms:
480 template<class T> void swap(shared_ptr<T>& a, shared_ptr<T>& b) noexcept;
482 // shared_ptr casts:
484 shared_ptr<T> static_pointer_cast(shared_ptr<U> const& r) noexcept;
486 shared_ptr<T> dynamic_pointer_cast(shared_ptr<U> const& r) noexcept;
488 shared_ptr<T> const_pointer_cast(shared_ptr<U> const& r) noexcept;
490 // shared_ptr I/O:
492 basic_ostream<E, T>& operator<< (basic_ostream<E, T>& os, shared_ptr<Y> const& p);
494 // shared_ptr get_deleter:
495 template<class D, class T> D* get_deleter(shared_ptr<T> const& p) noexcept;
498 shared_ptr<T> make_shared(Args&&... args);
500 shared_ptr<T> allocate_shared(const A& a, Args&&... args);
510 template<class Y> weak_ptr(shared_ptr<Y> const& r) noexcept;
522 template<class Y> weak_ptr& operator=(shared_ptr<Y> const& r) noexcept;
533 shared_ptr<T> lock() const noexcept;
534 template<class U> bool owner_before(shared_ptr<U> const& b) const;
545 struct owner_less<shared_ptr<T>>
546 : binary_function<shared_ptr<T>, shared_ptr<T>, bool>
549 bool operator()(shared_ptr<T> const&, shared_ptr<T> const&) const;
550 bool operator()(shared_ptr<T> const&, weak_ptr<T> const&) const;
551 bool operator()(weak_ptr<T> const&, shared_ptr<T> const&) const;
560 bool operator()(shared_ptr<T> const&, weak_ptr<T> const&) const;
561 bool operator()(weak_ptr<T> const&, shared_ptr<T> const&) const;
573 shared_ptr<T> shared_from_this();
574 shared_ptr<T const> shared_from_this() const;
578 bool atomic_is_lock_free(const shared_ptr<T>* p);
580 shared_ptr<T> atomic_load(const shared_ptr<T>* p);
582 shared_ptr<T> atomic_load_explicit(const shared_ptr<T>* p, memory_order mo);
584 void atomic_store(shared_ptr<T>* p, shared_ptr<T> r);
586 void atomic_store_explicit(shared_ptr<T>* p, shared_ptr<T> r, memory_order mo);
588 shared_ptr<T> atomic_exchange(shared_ptr<T>* p, shared_ptr<T> r);
590 shared_ptr<T>
591 atomic_exchange_explicit(shared_ptr<T>* p, shared_ptr<T> r, memory_order mo);
594 atomic_compare_exchange_weak(shared_ptr<T>* p, shared_ptr<T>* v, shared_ptr<T> w);
597 atomic_compare_exchange_strong( shared_ptr<T>* p, shared_ptr<T>* v, shared_ptr<T> w);
600 atomic_compare_exchange_weak_explicit(shared_ptr<T>* p, shared_ptr<T>* v,
601 shared_ptr<T> w, memory_order success,
605 atomic_compare_exchange_strong_explicit(shared_ptr<T>* p, shared_ptr<T>* v,
606 shared_ptr<T> w, memory_order success,
611 template <class T> struct hash<shared_ptr<T> >;
3607 class _LIBCPP_TEMPLATE_VIS shared_ptr
3622 _LIBCPP_CONSTEXPR shared_ptr() _NOEXCEPT;
3624 _LIBCPP_CONSTEXPR shared_ptr(nullptr_t) _NOEXCEPT;
3626 explicit shared_ptr(_Yp* __p,
3629 shared_ptr(_Yp* __p, _Dp __d,
3632 shared_ptr(_Yp* __p, _Dp __d, _Alloc __a,
3634 template <class _Dp> shared_ptr(nullptr_t __p, _Dp __d);
3635 template <class _Dp, class _Alloc> shared_ptr(nullptr_t __p, _Dp __d, _Alloc __a);
3636 …template<class _Yp> _LIBCPP_INLINE_VISIBILITY shared_ptr(const shared_ptr<_Yp>& __r, element_type*…
3638 shared_ptr(const shared_ptr& __r) _NOEXCEPT;
3641 shared_ptr(const shared_ptr<_Yp>& __r,
3646 shared_ptr(shared_ptr&& __r) _NOEXCEPT;
3647 template<class _Yp> _LIBCPP_INLINE_VISIBILITY shared_ptr(shared_ptr<_Yp>&& __r,
3651 template<class _Yp> explicit shared_ptr(const weak_ptr<_Yp>& __r,
3656 shared_ptr(auto_ptr<_Yp>&& __r,
3660 shared_ptr(auto_ptr<_Yp> __r,
3666 shared_ptr(unique_ptr<_Yp, _Dp>&&,
3675 shared_ptr(unique_ptr<_Yp, _Dp>&&,
3685 shared_ptr(unique_ptr<_Yp, _Dp>,
3694 shared_ptr(unique_ptr<_Yp, _Dp>,
3704 ~shared_ptr();
3707 shared_ptr& operator=(const shared_ptr& __r) _NOEXCEPT;
3712 shared_ptr&
3715 operator=(const shared_ptr<_Yp>& __r) _NOEXCEPT;
3718 shared_ptr& operator=(shared_ptr&& __r) _NOEXCEPT;
3723 shared_ptr<_Tp>&
3726 operator=(shared_ptr<_Yp>&& __r);
3734 shared_ptr
3746 shared_ptr&
3756 shared_ptr&
3767 void swap(shared_ptr& __r) _NOEXCEPT;
3810 bool owner_before(shared_ptr<_Up> const& __p) const
3818 __owner_equivalent(const shared_ptr& __p) const
3832 shared_ptr<_Tp>
3837 shared_ptr<_Tp>
3842 static shared_ptr<_Tp> make_shared();
3845 static shared_ptr<_Tp> make_shared(_A0&);
3848 static shared_ptr<_Tp> make_shared(_A0&, _A1&);
3851 static shared_ptr<_Tp> make_shared(_A0&, _A1&, _A2&);
3854 static shared_ptr<_Tp>
3858 static shared_ptr<_Tp>
3862 static shared_ptr<_Tp>
3866 static shared_ptr<_Tp>
3882 __e->__weak_this_ = shared_ptr<_RawYp>(*this,
3890 template <class _Up> friend class _LIBCPP_TEMPLATE_VIS shared_ptr;
3897 shared_ptr<_Tp>::shared_ptr() _NOEXCEPT
3906 shared_ptr<_Tp>::shared_ptr(nullptr_t) _NOEXCEPT
3914 shared_ptr<_Tp>::shared_ptr(_Yp* __p,
3927 shared_ptr<_Tp>::shared_ptr(_Yp* __p, _Dp __d,
3950 shared_ptr<_Tp>::shared_ptr(nullptr_t __p, _Dp __d)
3971 shared_ptr<_Tp>::shared_ptr(_Yp* __p, _Dp __d, _Alloc __a,
4000 shared_ptr<_Tp>::shared_ptr(nullptr_t __p, _Dp __d, _Alloc __a)
4028 shared_ptr<_Tp>::shared_ptr(const shared_ptr<_Yp>& __r, element_type *__p) _NOEXCEPT
4038 shared_ptr<_Tp>::shared_ptr(const shared_ptr& __r) _NOEXCEPT
4049 shared_ptr<_Tp>::shared_ptr(const shared_ptr<_Yp>& __r,
4063 shared_ptr<_Tp>::shared_ptr(shared_ptr&& __r) _NOEXCEPT
4074 shared_ptr<_Tp>::shared_ptr(shared_ptr<_Yp>&& __r,
4090 shared_ptr<_Tp>::shared_ptr(auto_ptr<_Yp>&& __r,
4092 shared_ptr<_Tp>::shared_ptr(auto_ptr<_Yp> __r,
4107 shared_ptr<_Tp>::shared_ptr(unique_ptr<_Yp, _Dp>&& __r,
4109 shared_ptr<_Tp>::shared_ptr(unique_ptr<_Yp, _Dp> __r,
4136 shared_ptr<_Tp>::shared_ptr(unique_ptr<_Yp, _Dp>&& __r,
4138 shared_ptr<_Tp>::shared_ptr(unique_ptr<_Yp, _Dp> __r,
4168 shared_ptr<_Tp>
4169 shared_ptr<_Tp>::make_shared(_Args&& ...__args)
4177 shared_ptr<_Tp> __r;
4186 shared_ptr<_Tp>
4187 shared_ptr<_Tp>::allocate_shared(const _Alloc& __a, _Args&& ...__args)
4196 shared_ptr<_Tp> __r;
4206 shared_ptr<_Tp>
4207 shared_ptr<_Tp>::make_shared()
4215 shared_ptr<_Tp> __r;
4224 shared_ptr<_Tp>
4225 shared_ptr<_Tp>::make_shared(_A0& __a0)
4233 shared_ptr<_Tp> __r;
4242 shared_ptr<_Tp>
4243 shared_ptr<_Tp>::make_shared(_A0& __a0, _A1& __a1)
4251 shared_ptr<_Tp> __r;
4260 shared_ptr<_Tp>
4261 shared_ptr<_Tp>::make_shared(_A0& __a0, _A1& __a1, _A2& __a2)
4269 shared_ptr<_Tp> __r;
4278 shared_ptr<_Tp>
4279 shared_ptr<_Tp>::allocate_shared(const _Alloc& __a)
4288 shared_ptr<_Tp> __r;
4297 shared_ptr<_Tp>
4298 shared_ptr<_Tp>::allocate_shared(const _Alloc& __a, _A0& __a0)
4307 shared_ptr<_Tp> __r;
4316 shared_ptr<_Tp>
4317 shared_ptr<_Tp>::allocate_shared(const _Alloc& __a, _A0& __a0, _A1& __a1)
4326 shared_ptr<_Tp> __r;
4335 shared_ptr<_Tp>
4336 shared_ptr<_Tp>::allocate_shared(const _Alloc& __a, _A0& __a0, _A1& __a1, _A2& __a2)
4345 shared_ptr<_Tp> __r;
4355 shared_ptr<_Tp>::~shared_ptr()
4363 shared_ptr<_Tp>&
4364 shared_ptr<_Tp>::operator=(const shared_ptr& __r) _NOEXCEPT
4366 shared_ptr(__r).swap(*this);
4375 is_convertible<_Yp*, typename shared_ptr<_Tp>::element_type*>::value,
4376 shared_ptr<_Tp>&
4378 shared_ptr<_Tp>::operator=(const shared_ptr<_Yp>& __r) _NOEXCEPT
4380 shared_ptr(__r).swap(*this);
4388 shared_ptr<_Tp>&
4389 shared_ptr<_Tp>::operator=(shared_ptr&& __r) _NOEXCEPT
4391 shared_ptr(_VSTD::move(__r)).swap(*this);
4400 is_convertible<_Yp*, typename shared_ptr<_Tp>::element_type*>::value,
4401 shared_ptr<_Tp>&
4403 shared_ptr<_Tp>::operator=(shared_ptr<_Yp>&& __r)
4405 shared_ptr(_VSTD::move(__r)).swap(*this);
4416 is_convertible<_Yp*, typename shared_ptr<_Tp>::element_type*>::value,
4417 shared_ptr<_Tp>
4419 shared_ptr<_Tp>::operator=(auto_ptr<_Yp>&& __r)
4421 shared_ptr(_VSTD::move(__r)).swap(*this);
4433 typename shared_ptr<_Tp>::element_type*>::value,
4434 shared_ptr<_Tp>&
4436 shared_ptr<_Tp>::operator=(unique_ptr<_Yp, _Dp>&& __r)
4438 shared_ptr(_VSTD::move(__r)).swap(*this);
4451 is_convertible<_Yp*, typename shared_ptr<_Tp>::element_type*>::value,
4452 shared_ptr<_Tp>&
4454 shared_ptr<_Tp>::operator=(auto_ptr<_Yp> __r)
4456 shared_ptr(__r).swap(*this);
4468 typename shared_ptr<_Tp>::element_type*>::value,
4469 shared_ptr<_Tp>&
4471 shared_ptr<_Tp>::operator=(unique_ptr<_Yp, _Dp> __r)
4473 shared_ptr(_VSTD::move(__r)).swap(*this);
4482 shared_ptr<_Tp>::swap(shared_ptr& __r) _NOEXCEPT
4491 shared_ptr<_Tp>::reset() _NOEXCEPT
4493 shared_ptr().swap(*this);
4501 is_convertible<_Yp*, typename shared_ptr<_Tp>::element_type*>::value,
4504 shared_ptr<_Tp>::reset(_Yp* __p)
4506 shared_ptr(__p).swap(*this);
4514 is_convertible<_Yp*, typename shared_ptr<_Tp>::element_type*>::value,
4517 shared_ptr<_Tp>::reset(_Yp* __p, _Dp __d)
4519 shared_ptr(__p, __d).swap(*this);
4527 is_convertible<_Yp*, typename shared_ptr<_Tp>::element_type*>::value,
4530 shared_ptr<_Tp>::reset(_Yp* __p, _Dp __d, _Alloc __a)
4532 shared_ptr(__p, __d, __a).swap(*this);
4542 shared_ptr<_Tp>
4546 return shared_ptr<_Tp>::make_shared(_VSTD::forward<_Args>(__args)...);
4554 shared_ptr<_Tp>
4558 return shared_ptr<_Tp>::allocate_shared(__a, _VSTD::forward<_Args>(__args)...);
4565 shared_ptr<_Tp>
4568 return shared_ptr<_Tp>::make_shared();
4573 shared_ptr<_Tp>
4576 return shared_ptr<_Tp>::make_shared(__a0);
4581 shared_ptr<_Tp>
4584 return shared_ptr<_Tp>::make_shared(__a0, __a1);
4589 shared_ptr<_Tp>
4592 return shared_ptr<_Tp>::make_shared(__a0, __a1, __a2);
4597 shared_ptr<_Tp>
4600 return shared_ptr<_Tp>::allocate_shared(__a);
4605 shared_ptr<_Tp>
4608 return shared_ptr<_Tp>::allocate_shared(__a, __a0);
4613 shared_ptr<_Tp>
4616 return shared_ptr<_Tp>::allocate_shared(__a, __a0, __a1);
4621 shared_ptr<_Tp>
4624 return shared_ptr<_Tp>::allocate_shared(__a, __a0, __a1, __a2);
4632 operator==(const shared_ptr<_Tp>& __x, const shared_ptr<_Up>& __y) _NOEXCEPT
4640 operator!=(const shared_ptr<_Tp>& __x, const shared_ptr<_Up>& __y) _NOEXCEPT
4648 operator<(const shared_ptr<_Tp>& __x, const shared_ptr<_Up>& __y) _NOEXCEPT
4657 operator>(const shared_ptr<_Tp>& __x, const shared_ptr<_Up>& __y) _NOEXCEPT
4665 operator<=(const shared_ptr<_Tp>& __x, const shared_ptr<_Up>& __y) _NOEXCEPT
4673 operator>=(const shared_ptr<_Tp>& __x, const shared_ptr<_Up>& __y) _NOEXCEPT
4681 operator==(const shared_ptr<_Tp>& __x, nullptr_t) _NOEXCEPT
4689 operator==(nullptr_t, const shared_ptr<_Tp>& __x) _NOEXCEPT
4697 operator!=(const shared_ptr<_Tp>& __x, nullptr_t) _NOEXCEPT
4705 operator!=(nullptr_t, const shared_ptr<_Tp>& __x) _NOEXCEPT
4713 operator<(const shared_ptr<_Tp>& __x, nullptr_t) _NOEXCEPT
4721 operator<(nullptr_t, const shared_ptr<_Tp>& __x) _NOEXCEPT
4729 operator>(const shared_ptr<_Tp>& __x, nullptr_t) _NOEXCEPT
4737 operator>(nullptr_t, const shared_ptr<_Tp>& __x) _NOEXCEPT
4745 operator<=(const shared_ptr<_Tp>& __x, nullptr_t) _NOEXCEPT
4753 operator<=(nullptr_t, const shared_ptr<_Tp>& __x) _NOEXCEPT
4761 operator>=(const shared_ptr<_Tp>& __x, nullptr_t) _NOEXCEPT
4769 operator>=(nullptr_t, const shared_ptr<_Tp>& __x) _NOEXCEPT
4777 swap(shared_ptr<_Tp>& __x, shared_ptr<_Tp>& __y) _NOEXCEPT
4787 shared_ptr<_Tp>
4789 static_pointer_cast(const shared_ptr<_Up>& __r) _NOEXCEPT
4791 return shared_ptr<_Tp>(__r, static_cast<_Tp*>(__r.get()));
4799 shared_ptr<_Tp>
4801 dynamic_pointer_cast(const shared_ptr<_Up>& __r) _NOEXCEPT
4804 return __p ? shared_ptr<_Tp>(__r, __p) : shared_ptr<_Tp>();
4811 shared_ptr<_Tp>
4813 const_pointer_cast(const shared_ptr<_Up>& __r) _NOEXCEPT
4816 return shared_ptr<_Tp>(__r, const_cast<_RTp*>(__r.get()));
4824 get_deleter(const shared_ptr<_Tp>& __p) _NOEXCEPT
4843 template<class _Yp> _LIBCPP_INLINE_VISIBILITY weak_ptr(shared_ptr<_Yp> const& __r,
4894 operator=(shared_ptr<_Yp> const& __r) _NOEXCEPT;
4907 shared_ptr<_Tp> lock() const _NOEXCEPT;
4910 bool owner_before(const shared_ptr<_Up>& __r) const
4918 template <class _Up> friend class _LIBCPP_TEMPLATE_VIS shared_ptr;
4943 weak_ptr<_Tp>::weak_ptr(shared_ptr<_Yp> const& __r,
5058 weak_ptr<_Tp>::operator=(shared_ptr<_Yp> const& __r) _NOEXCEPT
5091 shared_ptr<_Tp>::shared_ptr(const weak_ptr<_Yp>& __r,
5101 shared_ptr<_Tp>
5104 shared_ptr<_Tp> __r;
5118 struct _LIBCPP_TEMPLATE_VIS owner_less<shared_ptr<_Tp> >
5119 : binary_function<shared_ptr<_Tp>, shared_ptr<_Tp>, bool>
5123 bool operator()(shared_ptr<_Tp> const& __x, shared_ptr<_Tp> const& __y) const
5126 bool operator()(shared_ptr<_Tp> const& __x, weak_ptr<_Tp> const& __y) const
5129 bool operator()( weak_ptr<_Tp> const& __x, shared_ptr<_Tp> const& __y) const
5142 bool operator()(shared_ptr<_Tp> const& __x, weak_ptr<_Tp> const& __y) const
5145 bool operator()( weak_ptr<_Tp> const& __x, shared_ptr<_Tp> const& __y) const
5155 bool operator()( shared_ptr<_Tp> const& __x, shared_ptr<_Up> const& __y) const
5159 bool operator()( shared_ptr<_Tp> const& __x, weak_ptr<_Up> const& __y) const
5163 bool operator()( weak_ptr<_Tp> const& __x, shared_ptr<_Up> const& __y) const
5189 shared_ptr<_Tp> shared_from_this()
5190 {return shared_ptr<_Tp>(__weak_this_);}
5192 shared_ptr<_Tp const> shared_from_this() const
5193 {return shared_ptr<const _Tp>(__weak_this_);}
5205 template <class _Up> friend class shared_ptr;
5209 struct _LIBCPP_TEMPLATE_VIS hash<shared_ptr<_Tp> >
5211 typedef shared_ptr<_Tp> argument_type;
5224 operator<<(basic_ostream<_CharT, _Traits>& __os, shared_ptr<_Yp> const& __p);
5249 atomic_is_lock_free(const shared_ptr<_Tp>*)
5255 shared_ptr<_Tp>
5256 atomic_load(const shared_ptr<_Tp>* __p)
5260 shared_ptr<_Tp> __q = *__p;
5267 shared_ptr<_Tp>
5268 atomic_load_explicit(const shared_ptr<_Tp>* __p, memory_order)
5275 atomic_store(shared_ptr<_Tp>* __p, shared_ptr<_Tp> __r)
5286 atomic_store_explicit(shared_ptr<_Tp>* __p, shared_ptr<_Tp> __r, memory_order)
5292 shared_ptr<_Tp>
5293 atomic_exchange(shared_ptr<_Tp>* __p, shared_ptr<_Tp> __r)
5304 shared_ptr<_Tp>
5305 atomic_exchange_explicit(shared_ptr<_Tp>* __p, shared_ptr<_Tp> __r, memory_order)
5312 atomic_compare_exchange_strong(shared_ptr<_Tp>* __p, shared_ptr<_Tp>* __v, shared_ptr<_Tp> __w)
5314 shared_ptr<_Tp> __temp;
5333 atomic_compare_exchange_weak(shared_ptr<_Tp>* __p, shared_ptr<_Tp>* __v, shared_ptr<_Tp> __w)
5341 atomic_compare_exchange_strong_explicit(shared_ptr<_Tp>* __p, shared_ptr<_Tp>* __v,
5342 shared_ptr<_Tp> __w, memory_order, memory_order)
5350 atomic_compare_exchange_weak_explicit(shared_ptr<_Tp>* __p, shared_ptr<_Tp>* __v,
5351 shared_ptr<_Tp> __w, memory_order, memory_order)