[#BloombergLP-bslstl-BadWeakPtr]
= xref:BloombergLP.adoc[BloombergLP]::xref:BloombergLP/bslstl.adoc[bslstl]::BadWeakPtr
:relfileprefix: ../../
:mrdocs:

This `class` provides an exception type thrown when a `weak&lowbar;ptr` object is locked after the managed object has been destroyed&period; This class conforms to the C&plus;&plus;11 standard specification of `std&colon;&colon;bad&lowbar;weak&lowbar;ptr`&period;

== Synopsis

Declared in `&lt;bslstl&lowbar;badweakptr&period;h&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
class BadWeakPtr
    : public std::exception
----

== Base Classes

[cols="1,4"]
|===
| Name| Description
| `std::exception`
| Base class for all library exceptions&period;
|===

== Member Functions

[cols="1,4"]
|===
| Name| Description
| xref:BloombergLP/bslstl/BadWeakPtr/2constructor.adoc[`BadWeakPtr`]         [.small]#[constructor]#
| Create a `BadWeakPtr` object&period; Note that this function is explicitly user&hyphen;declared, to make it simple to declare `const` objects of this type&period;
| xref:BloombergLP/bslstl/BadWeakPtr/2destructor.adoc[`&#126;BadWeakPtr`] [.small]#[destructor]# [.small]#[virtual]#
| Destroy this object&period;
| xref:BloombergLP/bslstl/BadWeakPtr/operator_assign-00.adoc[`operator&equals;`] 
| 
| xref:BloombergLP/bslstl/BadWeakPtr/what.adoc[`what`]  [.small]#[virtual]#
| Return a pointer to the string literal &quot;bad&lowbar;weak&lowbar;ptr&quot;, with a storage duration of the lifetime of the program&period; Note that the caller should _not_ attempt to free this memory&period; Note that the `bsls&lowbar;exceptionutil` macro `BSLS&lowbar;NOTHROW&lowbar;SPEC` is deliberately not used here, as a number of standard libraries declare `what` in the base `exception` class explicitly with the no&hyphen;throw specification, even in a build that may not recognize exceptions&period;
|===



[.small]#Created with https://www.mrdocs.com[MrDocs]#
