use*_*352 4 c++ dynamic std move-semantics object-slicing
例如,在
unique_ptr<Derived> = new deriv; std::vector<unique_ptr<Base>>.push_back(std::move(deriv));
将派生切片打字unique_ptr<Base>?
unique_ptr<Base>
Jam*_*lis 6
不会发生切片; 在unique_ptr<Base>将自己的指针Derived对象.
Derived
unique_ptr可以将派生类的A 隐式转换为unique_ptr基类.
unique_ptr
归档时间:
15 年,7 月 前
查看次数:
853 次
最近记录:
10 年,3 月 前