File tree Expand file tree Collapse file tree 1 file changed +4
-1
lines changed Expand file tree Collapse file tree 1 file changed +4
-1
lines changed Original file line number Diff line number Diff line change @@ -180,7 +180,7 @@ x++ // Add 1 to x, evaluates to original x (postfix)
180180x-- // Subtract 1 from x, evaluates to original x
181181typeid(x) // Type of x
182182typeid(T) // Equals typeid(x) if x is a T
183- dynamic_cast< T>(x) // Converts x to a T, checked at run time
183+ dynamic_cast< T>(x) // Converts x to a T, checked at run time.
184184static_cast< T>(x) // Converts x to a T, not checked
185185reinterpret_cast< T>(x) // Interpret bits of x as a T
186186const_cast< T>(x) // Converts x to same type T but not const
@@ -337,6 +337,9 @@ if (z == nullptr){
337337 cout << "Z null";
338338}
339339cout << *q;
340+ shared_ptr<B> r;
341+ r = dynamic_pointer_cast<B>(t); // Converts t to a shared_ptr<B>
342+
340343```
341344
342345## ` math.h ` , ` cmath ` (floating point math)
You can’t perform that action at this time.
0 commit comments