unique_ptr::swap

交换两个 unique_ptr 对象的指针。

void swap(unique_ptr& _Right);

参数

  • _Right
    unique_ptr 用于交换指针。

备注

成员函数将交换 stored_ptr 以及 right.stored_ptr 和 stored_deleter 的 right.stored_deleter。

要求

页眉: <内存>

命名空间: std

请参见

参考

unique_ptr 类

<memory>

C++ 标准库中的线程安全

其他资源

unique_ptr 成员

memory 成员