shared_ptr::owner_before

如果 shared_ptr 是之前指针所命令的,返回true。

template<class Other>
    bool owner_before(const shared_ptr<Other>& ptr);
template<class Other>
    bool owner_before(const weak_ptr<Other>& ptr);

参数

  • ptr
    shared_ptrweak_ptrlvalue 引用。

属性值/返回值

返回 true,则此 shared_ptr 排序在指针参数之前,错误,如果无效。

备注

如果 *this 为 ordered before,则 ptr,模板成员函数返回 true。

要求

页眉: <内存>

命名空间: std

请参见

参考

shared_ptr::owner_before