Freigeben über


owner_less

Ermöglicht Mischvergleiche, die auf Besitz basieren, freigegebener und schwacher Zeiger. Gibt true zurück, wenn der linke Parameter vor rechtem Parameter durch die Memberfunktion owner_before sortiert wird.

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
);
};

Parameter

  • _left
    Ein freigegebener oder schwacher Zeiger.

  • _Right
    Ein freigegebener oder schwacher Zeiger.

Eigenschaftswert/Rückgabewert

Gibt true zurück, wenn _Left vor _Right-Memberfunktion owner_before sortiert wird.

Hinweise

Die Vorlagenklassen definieren alle ihre Memberoperatoren als Rückgabe von _Left.owner_before(_Right).

Anforderungen

Header: <memory>

Namespace: std

Siehe auch

Referenz

shared_ptr::owner_before

weak_ptr::owner_before

<memory>