Return a shared_ptr obtained by const_cast from source.
Synopsis
Declared in <bslstl_sharedptr.h>
template<
class TARGET,
class SOURCE>
static
bsl::shared_ptr<TARGET>
constCast(bsl::shared_ptr<SOURCE> const& source) noexcept;
Description
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 const_cast<TARGET *>(source.get()). Note that a compiler diagnostic will be emitted indicating an error unless const_cast<TARGET *>(source.get()) is a valid expression.
Return Value
shared pointer obtained by const_cast from source
Parameters
Name |
Description |
source |
source shared pointer that supplies ownership |
Created with MrDocs