Movatterモバイル変換


[0]ホーム

URL:


cppreference.com
Namespaces
Variants
    Actions

      std::experimental::weak_ptr

      From cppreference.com
      <cpp‎ |experimental
       
       
       
       
       
      Defined in header<experimental/memory>
      template<class T>class weak_ptr;
      (library fundamentals TS)

      std::experimental::weak_ptr is a modified version ofstd::weak_ptr that interoperates withstd::experimental::shared_ptr and has support for arrays.

      Contents

      [edit]Member types

      Member type Definition
      element_typestd::remove_extent_t<T>

      [edit]Member functions

      constructs newweak_ptr
      (public member function)[edit]

      Members and non-members identical tostd::weak_ptr

      Member functions

      The following member functions work withstd::experimental::shared_ptr instead ofstd::shared_ptr andstd::experimental::weak_ptr instead ofstd::weak_ptr. The behavior is otherwise identical.

      destroys aweak_ptr
      (public member function ofstd::weak_ptr<T>)[edit]
      assigns theweak_ptr
      (public member function ofstd::weak_ptr<T>)[edit]
      Modifiers
      releases the ownership of the managed object
      (public member function ofstd::weak_ptr<T>)[edit]
      swaps the managed objects
      (public member function ofstd::weak_ptr<T>)[edit]
      Observers
      returns the number ofshared_ptr objects that manage the object
      (public member function ofstd::weak_ptr<T>)[edit]
      checks whether the referenced object was already deleted
      (public member function ofstd::weak_ptr<T>)[edit]
      creates ashared_ptr that manages the referenced object
      (public member function ofstd::weak_ptr<T>)[edit]
      provides owner-based ordering of weak pointers
      (public member function ofstd::weak_ptr<T>)[edit]

      Non-member functions

      This non-member function is declared in thestd::experimental namespace, and work withstd::experimental::weak_ptr rather thanstd::weak_ptr, but otherwise behaves identically to the corresponding C++14 function.

      specializes thestd::swap algorithm
      (function template)[edit]

      [edit]Example

      This section is incomplete
      Reason: no example
      Retrieved from "https://en.cppreference.com/mwiki/index.php?title=cpp/experimental/weak_ptr&oldid=164655"

      [8]ページ先頭

      ©2009-2025 Movatter.jp