[util.smartptr.weak.bad]

# 20 Memory management library [[mem]](./#mem)

## 20.3 Smart pointers [[smartptr]](smartptr#util.smartptr.weak.bad)

### 20.3.2 Shared-ownership pointers [[util.sharedptr]](util.sharedptr#util.smartptr.weak.bad)

#### 20.3.2.1 Class bad_weak_ptr [util.smartptr.weak.bad]

[ð](#lib:bad_weak_ptr)

namespace std {class bad_weak_ptr : public exception {public:// see [[exception]](exception "17.9.3 Class exception") for the specification of the special member functionsconstexpr const char* what() const noexcept override; };}

[1](#1)

[#](http://github.com/Eelis/draft/tree/9adde4bc1c62ec234483e63ea3b70a59724c745a/source/memory.tex#L3468)

An exception of type bad_weak_ptr is thrown by the shared_ptr constructor taking a weak_ptr[.](#1.sentence-1)

[ð](#lib:what,bad_weak_ptr)

`constexpr const char* what() const noexcept override;
`

[2](#2)

[#](http://github.com/Eelis/draft/tree/9adde4bc1c62ec234483e63ea3b70a59724c745a/source/memory.tex#L3478)

*Returns*: An implementation-defined ntbs[.](#2.sentence-1)
