std::experimental::static_pointer_cast, std::experimental::dynamic_pointer_cast, std::experimental::const_pointer_cast, std::experimental::
template
<
class T, class U >
std::experimental::shared_ptr
<T>
|
(1) | (library fundamentals TS) |
template
<
class T, class U >
std::experimental::shared_ptr
<T>
|
(2) | (library fundamentals TS) |
template
<
class T, class U >
std::experimental::shared_ptr
<T>
|
(3) | (library fundamentals TS) |
template
<
class T, class U >
std::experimental::shared_ptr
<T>
|
(4) | (library fundamentals TS) |
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
Let Y
be
typename
std::experimental::shared_ptr
<T>
::
element_type
, then the resulting std::experimental::shared_ptr
dynamic_cast
is a null pointer value, the returned shared_ptr
The behavior of these functions is undefined unless the corresponding cast from U*
to T*
is well formed:
Parameters
r | - | the pointer to convert |
Example
This section is incomplete Reason: no example |
See also
constructs new shared_ptr (public member function) |
|
applies static_cast, dynamic_cast, const_cast, or reinterpret_cast to the stored pointer (function template) |