Condividi tramite


owner_less

Consente ai confronti misti basati su proprietà dei puntatori condivisi e deboli.Restituisce true se il parametro di sinistra è ordinato prima del parametro dalla funzione membro 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
);
};

Parametri

  • _left
    Un puntatore condiviso o debole.

  • _Right
    Un puntatore condiviso o debole.

Valore proprietà/Valore restituito

Restituisce true se _Left viene ordinato prima _Right dalla funzione membro owner_before.

Note

Le classi modello definiscono tutti gli operatori il membro come restituire _Left.owner_before(_Right).

Requisiti

intestazione: <memory>

Spazio dei nomi: deviazione standard

Vedere anche

Riferimenti

shared_ptr::owner_before

weak_ptr::owner_before

<memory>