[#BloombergLP-bslstl-SharedPtrUtil-dynamicCast-03] = xref:BloombergLP.adoc[BloombergLP]::xref:BloombergLP/bslstl.adoc[bslstl]::xref:BloombergLP/bslstl/SharedPtrUtil.adoc[SharedPtrUtil]::dynamicCast :relfileprefix: ../../../ :mrdocs: Load into the specified `target` an aliased shared pointer sharing ownership of the object managed by the specified `source` shared pointer and referring to `dynamic_cast<TARGET *>(source.get())`. If `*target` is already managing a (possibly shared) object, then release the shared reference to that object, and destroy it using its associated deleter if that shared pointer held the last shared reference to that object. If `0 == dynamic_cast<TARGET*>(source.get())`, then `*target` shall be reset to an empty state that does not refer to an object. Note that a compiler diagnostic will be emitted indicating an error unless `dynamic_cast<TARGET *>(source.get())` is a valid expression. == Synopsis Declared in `<bslstl_sharedptr.h>` [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- template< class TARGET, class SOURCE> static void dynamicCast( xref:bsl/shared_ptr-0a.adoc[bsl::shared_ptr<TARGET>]* target, xref:bsl/shared_ptr-0a.adoc[bsl::shared_ptr<SOURCE>] const& source); ---- [.small]#Created with https://www.mrdocs.com[MrDocs]#