Home | History | Annotate | Download | only in bits

Lines Matching refs:__r

306         __shared_count(std::auto_ptr<_Tp>&& __r)
307 : _M_pi(new _Sp_counted_ptr<_Tp*, _Lp>(__r.get()))
308 { __r.release(); }
314 __shared_count(std::unique_ptr<_Tp, _Del>&& __r)
315 : _M_pi(_S_create_from_up(std::move(__r)))
316 { __r.release(); }
318 // Throw bad_weak_ptr when __r._M_get_use_count() == 0.
320 __shared_count(const __weak_count<_Lp>& __r);
328 __shared_count(const __shared_count& __r)
329 : _M_pi(__r._M_pi) // nothrow
336 operator=(const __shared_count& __r) // nothrow
338 _Sp_counted_base<_Lp>* __tmp = __r._M_pi;
351 _M_swap(__shared_count& __r) // nothrow
353 _Sp_counted_base<_Lp>* __tmp = __r._M_pi;
354 __r._M_pi = _M_pi;
388 _S_create_from_up(std::unique_ptr<_Tp, _Del>&& __r,
392 _Lp>(__r.get(), __r.get_deleter());
397 _S_create_from_up(std::unique_ptr<_Tp, _Del>&& __r,
403 _Lp>(__r.get(), std::ref(__r.get_deleter()));
418 __weak_count(const __shared_count<_Lp>& __r)
419 : _M_pi(__r._M_pi) // nothrow
425 __weak_count(const __weak_count<_Lp>& __r)
426 : _M_pi(__r._M_pi) // nothrow
439 operator=(const __shared_count<_Lp>& __r) // nothrow
441 _Sp_counted_base<_Lp>* __tmp = __r._M_pi;
451 operator=(const __weak_count<_Lp>& __r) // nothrow
453 _Sp_counted_base<_Lp>* __tmp = __r._M_pi;
463 _M_swap(__weak_count<_Lp>& __r) // nothrow
465 _Sp_counted_base<_Lp>* __tmp = __r._M_pi;
466 __r._M_pi = _M_pi;
497 __shared_count(const __weak_count<_Lp>& __r)
498 : _M_pi(__r._M_pi)
622 * and shares ownership with @a __r.
623 * @param __r A %__shared_ptr.
624 * @param __p A pointer that will remain valid while @a *__r is valid.
625 * @post get() == __p && use_count() == __r.use_count()
637 __shared_ptr(const __shared_ptr<_Tp1, _Lp>& __r, _Tp* __p)
638 : _M_ptr(__p), _M_refcount(__r._M_refcount) // never throws
643 /** @brief If @a __r is empty, constructs an empty %__shared_ptr;
645 * with @a __r.
646 * @param __r A %__shared_ptr.
647 * @post get() == __r.get() && use_count() == __r.use_count()
650 __shared_ptr(const __shared_ptr<_Tp1, _Lp>& __r)
651 : _M_ptr(__r._M_ptr), _M_refcount(__r._M_refcount) // never throws
654 /** @brief Move-constructs a %__shared_ptr instance from @a __r.
655 * @param __r A %__shared_ptr rvalue.
656 * @post *this contains the old value of @a __r, @a __r is empty.
658 __shared_ptr(__shared_ptr&& __r)
659 : _M_ptr(__r._M_ptr), _M_refcount() // never throws
661 _M_refcount._M_swap(__r._M_refcount);
662 __r._M_ptr = 0;
665 /** @brief Move-constructs a %__shared_ptr instance from @a __r.
666 * @param __r A %__shared_ptr rvalue.
667 * @post *this contains the old value of @a __r, @a __r is empty.
670 __shared_ptr(__shared_ptr<_Tp1, _Lp>&& __r)
671 : _M_ptr(__r._M_ptr), _M_refcount() // never throws
674 _M_refcount._M_swap(__r._M_refcount);
675 __r._M_ptr = 0;
678 /** @brief Constructs a %__shared_ptr that shares ownership with @a __r
679 * and stores a copy of the pointer stored in @a __r.
680 * @param __r A weak_ptr.
681 * @post use_count() == __r.use_count()
682 * @throw bad_weak_ptr when __r.expired(),
687 __shared_ptr(const __weak_ptr<_Tp1, _Lp>& __r)
688 : _M_refcount(__r._M_refcount) // may throw
691 // It is now safe to copy __r._M_ptr, as _M_refcount(__r._M_refcount)
693 _M_ptr = __r._M_ptr;
705 __shared_ptr(std::unique_ptr<_Tp1, _Del>&& __r)
706 : _M_ptr(__r.get()), _M_refcount()
709 _Tp1* __tmp = __r.get();
710 _M_refcount = __shared_count<_Lp>(std::move(__r));
716 * @post use_count() == 1 and __r.get() == 0
720 __shared_ptr(std::auto_ptr<_Tp1>&& __r)
721 : _M_ptr(__r.get()), _M_refcount()
724 // TODO requires _Tp1 is complete, delete __r.release() well-formed
725 _Tp1* __tmp = __r.get();
726 _M_refcount = __shared_count<_Lp>(std::move(__r));
733 operator=(const __shared_ptr<_Tp1, _Lp>& __r) // never throws
735 _M_ptr = __r._M_ptr;
736 _M_refcount = __r._M_refcount; // __shared_count::op= doesn't throw
743 operator=(std::auto_ptr<_Tp1>&& __r)
745 __shared_ptr(std::move(__r)).swap(*this);
751 operator=(__shared_ptr&& __r)
753 __shared_ptr(std::move(__r)).swap(*this);
759 operator=(__shared_ptr<_Tp1, _Lp>&& __r)
761 __shared_ptr(std::move(__r)).swap(*this);
767 operator=(const std::unique_ptr<_Tp1, _Del>& __r) = delete;
771 operator=(std::unique_ptr<_Tp1, _Del>&& __r)
773 __shared_ptr(std::move(__r)).swap(*this);
948 * <code>shared_ptr<_Tp, _Lp>(static_cast<_Tp*>(__r.get()))</code>
954 static_pointer_cast(const __shared_ptr<_Tp1, _Lp>& __r)
955 { return __shared_ptr<_Tp, _Lp>(__r, static_cast<_Tp*>(__r.get())); }
958 * <code>shared_ptr<_Tp, _Lp>(const_cast<_Tp*>(__r.get()))</code>
964 const_pointer_cast(const __shared_ptr<_Tp1, _Lp>& __r)
965 { return __shared_ptr<_Tp, _Lp>(__r, const_cast<_Tp*>(__r.get())); }
968 * <code>shared_ptr<_Tp, _Lp>(dynamic_cast<_Tp*>(__r.get()))</code>
974 dynamic_pointer_cast(const __shared_ptr<_Tp1, _Lp>& __r)
976 if (_Tp* __p = dynamic_cast<_Tp*>(__r.get()))
977 return __shared_ptr<_Tp, _Lp>(__r, __p);
1013 // __weak_ptr(const __weak_ptr<_Tp1, _Lp>& __r)
1014 // : _M_ptr(__r._M_ptr), _M_refcount(__r._M_refcount) // never throws
1019 // __r._M_ptr may already have been invalidated. The _M_ptr(__r._M_ptr)
1020 // conversion may require access to *__r._M_ptr (virtual inheritance).
1023 // in multithreaded programs __r._M_ptr may be invalidated at any point.
1025 __weak_ptr(const __weak_ptr<_Tp1, _Lp>& __r)
1026 : _M_refcount(__r._M_refcount) // never throws
1029 _M_ptr = __r.lock().get();
1033 __r)
1034 : _M_ptr(__r._M_ptr), _M_refcount(__r._M_refcount) // never throws
1039 operator=(const __weak_ptr<_Tp1, _Lp>& __r) // never throws
1041 _M_ptr = __r.lock().get();
1042 _M_refcount = __r._M_refcount;
1048 operator=(const __shared_ptr<_Tp1, _Lp>& __r) // never throws
1050 _M_ptr = __r._M_ptr;
1051 _M_refcount = __r._M_refcount;
1246 shared_ptr(const shared_ptr<_Tp1>& __r, _Tp* __p)
1247 : __shared_ptr<_Tp>(__r, __p) { }
1250 shared_ptr(const shared_ptr<_Tp1>& __r)
1251 : __shared_ptr<_Tp>(__r) { }
1253 shared_ptr(shared_ptr&& __r)
1254 : __shared_ptr<_Tp>(std::move(__r)) { }
1257 shared_ptr(shared_ptr<_Tp1>&& __r)
1258 : __shared_ptr<_Tp>(std::move(__r)) { }
1262 shared_ptr(const weak_ptr<_Tp1>& __r)
1263 : __shared_ptr<_Tp>(__r) { }
1268 shared_ptr(std::auto_ptr<_Tp1>&& __r)
1269 : __shared_ptr<_Tp>(std::move(__r)) { }
1278 shared_ptr(std::unique_ptr<_Tp1, _Del>&& __r)
1279 : __shared_ptr<_Tp>(std::move(__r)) { }
1283 operator=(const shared_ptr<_Tp1>& __r) // never throws
1285 this->__shared_ptr<_Tp>::operator=(__r);
1292 operator=(std::auto_ptr<_Tp1>&& __r)
1294 this->__shared_ptr<_Tp>::operator=(std::move(__r));
1300 operator=(shared_ptr&& __r)
1302 this->__shared_ptr<_Tp>::operator=(std::move(__r));
1308 operator=(shared_ptr<_Tp1>&& __r)
1310 this->__shared_ptr<_Tp>::operator=(std::move(__r));
1316 operator=(const std::unique_ptr<_Tp1, _Del>& __r) = delete;
1320 operator=(std::unique_ptr<_Tp1, _Del>&& __r)
1322 this->__shared_ptr<_Tp>::operator=(std::move(__r));
1368 static_pointer_cast(const shared_ptr<_Tp1>& __r)
1369 { return shared_ptr<_Tp>(__r, static_cast<_Tp*>(__r.get())); }
1373 const_pointer_cast(const shared_ptr<_Tp1>& __r)
1374 { return shared_ptr<_Tp>(__r, const_cast<_Tp*>(__r.get())); }
1378 dynamic_pointer_cast(const shared_ptr<_Tp1>& __r)
1380 if (_Tp* __p = dynamic_cast<_Tp*>(__r.get()))
1381 return shared_ptr<_Tp>(__r, __p);
1400 weak_ptr(const weak_ptr<_Tp1>& __r)
1401 : __weak_ptr<_Tp>(__r) { }
1404 weak_ptr(const shared_ptr<_Tp1>& __r)
1405 : __weak_ptr<_Tp>(__r) { }
1409 operator=(const weak_ptr<_Tp1>& __r) // never throws
1411 this->__weak_ptr<_Tp>::operator=(__r);
1417 operator=(const shared_ptr<_Tp1>& __r) // never throws
1419 this->__weak_ptr<_Tp>::operator=(__r);