![]() |
![]()
| ![]() |
![]()
NAMEstd::weak_ptr::expired - std::weak_ptr::expired Synopsisbool expired() const noexcept; (since C++11)
Parameters(none) Return valuetrue if the managed object has already been deleted, false otherwise. Notes This function is inherently racy if the managed object is shared
among threads. In
ExampleDemonstrates how expired is used to check validity of the pointer. // Run this code
Output: gw is valid
See also lock creates a shared_ptr that manages the referenced object
|