std::swap(std::shared_ptr)

template< class T >
void swap( shared_ptr<T>& lhs, shared_ptr<T>& rhs ) noexcept;
(C++11 起)

std::shared_ptr 特化 std::swap 算法。交换 lhsrhs 的指针。调用 lhs.swap(rhs)


目录

参数

lhs, rhs - 要交换内容的智能指针

返回值

(无)

复杂度

常数

参阅

交换两个对象的值
(函数模板)
交换内容
(公开成员函数)

版本历史

  • (当前 | 先前 2012年11月2日 (五) 14:39P12bot讨论 | 贡献 . . (312字节) (+281). . (r2.7.3) (机器人添加:de, en, es, fr, it, ja, pt, ru) (撤销)
  • 当前 | 先前 2012年10月25日 (四) 14:55P12讨论 | 贡献 . . (31字节) (0). . (1个修订: Translate from the English version) (撤销)
  • 当前 | 先前) 2012年10月22日 (一) 14:48TranslationBot讨论 | 贡献. . (31字节) (+31). . (Translated from the English version using Google Translate)