Return a shared_ptr obtained by dynamic_cast from source.
Declared in <bslstl_sharedptr.h>
template<
class TO_TYPE,
class FROM_TYPE>
bsl::shared_ptr<TO_TYPE>
dynamic_pointer_cast(shared_ptr<FROM_TYPE> const& source) noexcept;
Return a shared_ptr<TO_TYPE> object sharing ownership of the same object as the specified source shared pointer to the (template parameter) FROM_TYPE, and referring to dynamic_cast<TO_TYPE*>(source.get()). If source cannot be dynamically cast to TO_TYPE *, then an empty shared_ptr<TO_TYPE> object is returned.
shared pointer obtained by dynamic_cast from source
| Name | Description |
|---|---|
| source | source shared pointer that supplies ownership |