Sdílet prostřednictvím


owner_less

Umožňuje smíšené porovnání sdílených a slabých ukazatelů na základě vlastnictví.Vrátí true -li parametr levé objednané před pravé parametr členské funkce 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
);
};

Parametry

  • _left
    Sdílené nebo malý ukazatel.

  • _Right
    Sdílené nebo malý ukazatel.

Hodnota/návratová hodnota vlastnosti

Vrátí true -li _Left je řazen před _Right členské funkce owner_before.

Poznámky

Šablona třídy definovat všechny své členské subjekty jako vrácení _Left.owner_before(_Right).

Požadavky

Záhlaví: <paměť>

Obor názvů: std

Viz také

Referenční dokumentace

shared_ptr::owner_before

weak_ptr::owner_before

<memory>