std::swap(std::unique_ptr)
来自cppreference.com
< cpp | memory | unique ptr
![]() |
该页由英文版wiki使用Google Translate机器翻译而来。
该翻译可能存在错误或用词不当。鼠标停留在文本上可以看到原版本。你可以帮助我们修正错误或改进翻译。参见说明请点击这里. |
template< class T, class Deleter > void swap( unique_ptr<T,Deleter> &lhs, unique_ptr<T,Deleter> &rhs ); |
(C++11 起) | |
专为std::swapstd::unique_ptr算法。
lhs
和rhs
交换的指针。呼叫lhs.swap(rhs).原文:
Specializes the std::swap algorithm for std::unique_ptr. Swaps the pointers of
lhs
and rhs
. Calls lhs.swap(rhs).目录 |
[编辑] 参数
lhs, rhs | - | 智能指针的内容交换
原文: smart pointers whose contents to swap |
[编辑] 返回值
(无)
[编辑] 复杂性
常数
[编辑] 另请参阅
交换的内容 (公共成员函数) |