std::bad_weak_ptr (3) - Linux Manuals
std::bad_weak_ptr: std::bad_weak_ptr
NAME
std::bad_weak_ptr - std::bad_weak_ptr
Synopsis
Defined in header <memory>
class bad_weak_ptr; (since C++11)
std::bad_weak_ptr is the type of the object thrown as exceptions by the constructors of std::shared_ptr that take std::weak_ptr as the argument, when the std::weak_ptr refers to an already deleted object.
std-bad weak ptr-inheritance.svg
Inheritance diagram
Member functions
constructor (public member function)
std::bad_weak_ptr ::bad_weak_ptr()
bad_weak_ptr() noexcept;
Constructs a new instance of std::bad_weak_ptr. what() returns an implementation-defined null-terminated byte string.
Parameters
(none)
Inherited from std::exception
Member functions
destructor destroys the exception object
[virtual]
what returns an explanatory string
[virtual]
Example
// Run this code
Output:
See also
shared_ptr smart pointer with shared object ownership semantics
(C++11)
weak_ptr weak reference to an object managed by std::shared_ptr
(C++11)