std::experimental::static_pointer_cast,std::experimental::dynamic_pointer_cast, (3) - Linux Manuals
std::experimental::static_pointer_cast,std::experimental::dynamic_pointer_cast,: std::experimental::static_pointer_cast,std::experimental::dynamic_pointer_cast,
NAME
std::experimental::static_pointer_cast,std::experimental::dynamic_pointer_cast, - std::experimental::static_pointer_cast,std::experimental::dynamic_pointer_cast,
Synopsis
template<
std::experimental::shared_ptr<T>
const std::experimental::shared_ptr<U>&
template<
std::experimental::shared_ptr<T>
const std::experimental::shared_ptr<U>&
template<
std::experimental::shared_ptr<T>
std::experimental::shared_ptr<U>&
template<
std::experimental::shared_ptr<T>
const std::experimental::shared_ptr<U>&
Creates a new instance of std::experimental::shared_ptr whose stored pointer is
obtained from r's stored pointer using a cast expression. If r is empty, so is the
new shared_ptr
Otherwise, the new shared_ptr will share ownership with r, except that it is empty
if the dynamic_cast performed by dynamic_pointer_cast returns a null pointer.
Let Y be typename std::experimental::shared_ptr<T>::element_type, then the resulting
std::experimental::shared_ptr's stored pointer will be obtained by calling
respective order):
1)
2)
value, the returned shared_ptr will be empty).
3)
4)
The behavior of these functions is undefined unless the corresponding cast from U*
to T*
1)
2)
3)
4)
formed.
Parameters
r - The pointer to convert
Example
See also
constructor
static_pointer_cast
dynamic_pointer_cast
const_pointer_cast