BloombergLP::bslstl::SharedPtrUtil::staticCast

Return a bsl::shared_ptr<TARGET> object sharing ownership of the same object as the specified source shared pointer to the (template parameter) SOURCE type, and referring to static_cast<TARGET *>(source.get()). Note that a compiler diagnostic will be emitted indicating an error unless static_cast<TARGET *>(source.get()) is a valid expression.

Synopsis

Declared in <bslstl_sharedptr.h>

template<
    class TARGET,
    class SOURCE>
static
bsl::shared_ptr<TARGET>
staticCast(bsl::shared_ptr<SOURCE> const& source) noexcept;