Movatterモバイル変換


[0]ホーム

URL:


cppreference.com
Namespaces
Variants
    Actions

      std::experimental::weak_ptr<T>::weak_ptr

      From cppreference.com
      <cpp‎ |experimental‎ |weak ptr
       
       
       
       
       
      constexpr weak_ptr()noexcept;
      (1)(library fundamentals TS)
      weak_ptr(const weak_ptr& r)noexcept;
      (2)(library fundamentals TS)
      template<class Y>
      weak_ptr(const weak_ptr<Y>& r)noexcept;
      (2)(library fundamentals TS)
      template<class Y>
      weak_ptr(conststd::experimental::shared_ptr<Y>& r)noexcept;
      (2)(library fundamentals TS)
      weak_ptr( weak_ptr&& r)noexcept;
      (3)(library fundamentals TS)
      template<class Y>
      weak_ptr( weak_ptr<Y>&& r)noexcept;
      (3)(library fundamentals TS)

      Constructs a newweak_ptr that potentially shares an object withr.

      1) Default constructor. Constructs emptyweak_ptr.
      2) Constructs newweak_ptr which shares an object managed byr. Ifr manages no object,*this manages no object too. The templated overloads don't participate in overload resolution unless eitherY* is implicitly convertible toT*, orY is the type "array ofNU" for some typeU and some numberN, andT is the type "array of unknown bound of (possibly cv-qualified)U".
      3) Move constructors. Moves aweak_ptr instance fromr into*this. After this,r is empty andr.use_count()==0. The templated overload doesn't participate in overload resolution unless eitherY* is implicitly convertible toT*, orY is the type "array ofNU" for some typeU and some numberN, andT is the type "array of unknown bound of (possibly cv-qualified)U".

      Contents

      [edit]Parameters

      r - astd::experimental::shared_ptr orstd::experimental::weak_ptr that will be viewed by thisstd::experimental::weak_ptr

      [edit]Exceptions

      noexcept specification:  
      noexcept
        

      [edit]Example

      This section is incomplete
      Reason: no example

      [edit]See also

      creates a newweak_ptr
      (public member function ofstd::weak_ptr<T>)[edit]
      assigns theweak_ptr
      (public member function ofstd::weak_ptr<T>)[edit]
      Retrieved from "https://en.cppreference.com/mwiki/index.php?title=cpp/experimental/weak_ptr/weak_ptr&oldid=156383"

      [8]ページ先頭

      ©2009-2026 Movatter.jp