last changes from bloomberg.
This commit is contained in:
23
cpp/shared_ptr_cast.cpp
Normal file
23
cpp/shared_ptr_cast.cpp
Normal file
@@ -0,0 +1,23 @@
|
||||
/* Check cf5-opt.vim defs.
|
||||
VIM: let b:lcppflags="-std=c++11 -O2 -pthread"
|
||||
*/
|
||||
|
||||
#include <memory>
|
||||
|
||||
class A
|
||||
{
|
||||
int i;
|
||||
};
|
||||
|
||||
class B : public A
|
||||
{
|
||||
int j;
|
||||
};
|
||||
|
||||
int main()
|
||||
{
|
||||
std::shared_ptr<A> a = std::make_shared<B>();
|
||||
|
||||
std::shared_ptr<B> b = std::static_pointer_cast<B>(a);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user