Home | History | Annotate | Download | only in bits

Lines Matching defs:__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);
958 * <code>shared_ptr<_Tp, _Lp>(static_cast<_Tp*>(__r.get()))</code>
964 static_pointer_cast(const __shared_ptr<_Tp1, _Lp>& __r)
965 { return __shared_ptr<_Tp, _Lp>(__r, static_cast<_Tp*>(__r.get())); }
968 * <code>shared_ptr<_Tp, _Lp>(const_cast<_Tp*>(__r.get()))</code>
974 const_pointer_cast(const __shared_ptr<_Tp1, _Lp>& __r)
975 { return __shared_ptr<_Tp, _Lp>(__r, const_cast<_Tp*>(__r.get())); }
978 * <code>shared_ptr<_Tp, _Lp>(dynamic_cast<_Tp*>(__r.get()))</code>
984 dynamic_pointer_cast(const __shared_ptr<_Tp1, _Lp>& __r)
986 if (_Tp* __p = dynamic_cast<_Tp*>(__r.get()))
987 return __shared_ptr<_Tp, _Lp>(__r, __p);
1023 // __weak_ptr(const __weak_ptr<_Tp1, _Lp>& __r)
1024 // : _M_ptr(__r._M_ptr), _M_refcount(__r._M_refcount) // never throws
1029 // __r._M_ptr may already have been invalidated. The _M_ptr(__r._M_ptr)
1030 // conversion may require access to *__r._M_ptr (virtual inheritance).
1033 // in multithreaded programs __r._M_ptr may be invalidated at any point.
1035 __weak_ptr(const __weak_ptr<_Tp1, _Lp>& __r)
1036 : _M_refcount(__r._M_refcount) // never throws
1039 _M_ptr = __r.lock().get();
1043 __weak_ptr(const __shared_ptr<_Tp1, _Lp>& __r)
1044 : _M_ptr(__r._M_ptr), _M_refcount(__r._M_refcount) // never throws
1049 operator=(const __weak_ptr<_Tp1, _Lp>& __r) // never throws
1051 _M_ptr = __r.lock().get();
1052 _M_refcount = __r._M_refcount;
1058 operator=(const __shared_ptr<_Tp1, _Lp>& __r) // never throws
1060 _M_ptr = __r._M_ptr;
1061 _M_refcount = __r._M_refcount;
1256 shared_ptr(const shared_ptr<_Tp1>& __r, _Tp* __p)
1257 : __shared_ptr<_Tp>(__r, __p) { }
1260 shared_ptr(const shared_ptr<_Tp1>& __r)
1261 : __shared_ptr<_Tp>(__r) { }
1263 shared_ptr(shared_ptr&& __r)
1264 : __shared_ptr<_Tp>(std::move(__r)) { }
1267 shared_ptr(shared_ptr<_Tp1>&& __r)
1268 : __shared_ptr<_Tp>(std::move(__r)) { }
1272 shared_ptr(const weak_ptr<_Tp1>& __r)
1273 : __shared_ptr<_Tp>(__r) { }
1278 shared_ptr(std::auto_ptr<_Tp1>&& __r)
1279 : __shared_ptr<_Tp>(std::move(__r)) { }
1288 shared_ptr(std::unique_ptr<_Tp1, _Del>&& __r)
1289 : __shared_ptr<_Tp>(std::move(__r)) { }
1293 operator=(const shared_ptr<_Tp1>& __r) // never throws
1295 this->__shared_ptr<_Tp>::operator=(__r);
1302 operator=(std::auto_ptr<_Tp1>&& __r)
1304 this->__shared_ptr<_Tp>::operator=(std::move(__r));
1310 operator=(shared_ptr&& __r)
1312 this->__shared_ptr<_Tp>::operator=(std::move(__r));
1318 operator=(shared_ptr<_Tp1>&& __r)
1320 this->__shared_ptr<_Tp>::operator=(std::move(__r));
1326 operator=(const std::unique_ptr<_Tp1, _Del>& __r) = delete;
1330 operator=(std::unique_ptr<_Tp1, _Del>&& __r)
1332 this->__shared_ptr<_Tp>::operator=(std::move(__r));
1388 static_pointer_cast(const shared_ptr<_Tp1>& __r)
1389 { return shared_ptr<_Tp>(__r, static_cast<_Tp*>(__r.get())); }
1393 const_pointer_cast(const shared_ptr<_Tp1>& __r)
1394 { return shared_ptr<_Tp>(__r, const_cast<_Tp*>(__r.get())); }
1398 dynamic_pointer_cast(const shared_ptr<_Tp1>& __r)
1400 if (_Tp* __p = dynamic_cast<_Tp*>(__r.get()))
1401 return shared_ptr<_Tp>(__r, __p);
1420 weak_ptr(const weak_ptr<_Tp1>& __r)
1421 : __weak_ptr<_Tp>(__r) { }
1424 weak_ptr(const shared_ptr<_Tp1>& __r)
1425 : __weak_ptr<_Tp>(__r) { }
1429 operator=(const weak_ptr<_Tp1>& __r) // never throws
1431 this->__weak_ptr<_Tp>::operator=(__r);
1437 operator=(const shared_ptr<_Tp1>& __r) // never throws
1439 this->__weak_ptr<_Tp>::operator=(__r);