shared_ptr and slicing

后端 未结 2 663
后悔当初
后悔当初 2021-01-11 22:01

Someone I worked with once said that shared_ptr was unsafe and would slice when casting from a derived class to a base class (i.e. upcasting). For example if there were 2 cl

2条回答
提交回复
热议问题