1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21
|
template<class P> struct owner_less; // not defined
template<class T> struct owner_less <shared_ptr<T>>
{
typedef bool result_type;
typedef shared_ptr<T> first_argument_type;
typedef shared_ptr<T> second_argument_type;
bool operator() (const shared_ptr<T>& x, const shared_ptr<T>& y) const {return x.owner_before(y);}
bool operator() (const shared_ptr<T>& x, const weak_ptr<T>& y) const {return x.owner_before(y);}
bool operator() (const weak_ptr<T>& x, const shared_ptr<T>& y) const {return x.owner_before(y);}
};
template<class T> struct owner_less <weak_ptr<T>>
{
typedef bool result_type;
typedef weak_ptr<T> first_argument_type;
typedef weak_ptr<T> second_argument_type;
bool operator() (const weak_ptr<T>& x, const weak_ptr<T>& y) const {return x.owner_before(y);}
bool operator() (const shared_ptr<T>& x, const weak_ptr<T>& y) const {return x.owner_before(y);}
bool operator() (const weak_ptr<T>& x, const shared_ptr<T>& y) const {return x.owner_before(y);}
};
|