Return a shared_ptr obtained by reinterpret_cast from source.
Synopsis
Declared in <bslstl_sharedptr.h>
template<
class TO_TYPE,
class FROM_TYPE>
bsl::shared_ptr<TO_TYPE>
reinterpret_pointer_cast(shared_ptr<FROM_TYPE> const& source) noexcept;
Description
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 reinterpret_cast<TO_TYPE *>(source.get()). Note that if source cannot be reinterpret_cast‐ed to TO_TYPE *, then a compiler diagnostic will be emitted indicating the error.
Return Value
shared pointer obtained by reinterpret_cast from source
Parameters
Name |
Description |
source |
source shared pointer that supplies ownership |
Created with MrDocs