Export (0) Print
Expand All

owner_less

Allows ownership-based mixed comparisons of shared and weak pointers. Returns true if the left parameter is ordered before right parameter by the member function owner_before.

template<class Type>
    struct owner_less; // not defined

template<class Type>
    struct owner_less<shared_ptr<Type> > {
    bool operator()(
        const shared_ptr<Type>& _Left,
        const shared_ptr<Type>& _Right
);
    bool operator()(
        const shared_ptr<Type>& _Left,
        const weak_ptr<Type>& _Right
);
    bool operator()(
        const weak_ptr<Type>& _Left,
        const shared_ptr<Type>& _Right
);
};

template<class Type>
    struct owner_less<weak_ptr<Type> >
    bool operator()(
        const weak_ptr<Type>& _Left,
        const weak_ptr<Type>& _Right
);
    bool operator()(
        const weak_ptr<Type>& _Left,
        const shared_ptr<Ty>& _Right
);
    bool operator()(
        const shared_ptr<Type>& _Left,
        const weak_ptr<Type>& _Right
);
};

_left

A shared or weak pointer.

_Right

A shared or weak pointer.

Returns true if _Left is ordered before _Right by the member function owner_before.

The template classes define all their member operators as returning _Left.owner_before(_Right).

Header: <memory>

Namespace: std

Community Additions

ADD
Show:
© 2014 Microsoft