1 #ifndef BOOST_SMART_PTR_OWNER_LESS_HPP_INCLUDED
2 #define BOOST_SMART_PTR_OWNER_LESS_HPP_INCLUDED
7 // Copyright (c) 2008 Frank Mori Hess
9 // Distributed under the Boost Software License, Version 1.0. (See
10 // accompanying file LICENSE_1_0.txt or copy at
11 // http://www.boost.org/LICENSE_1_0.txt)
13 // See http://www.boost.org/libs/smart_ptr/smart_ptr.htm for documentation.
20 template<typename T> class shared_ptr;
21 template<typename T> class weak_ptr;
25 template<typename T, typename U>
26 struct generic_owner_less : public std::binary_function<T, T, bool>
28 bool operator()(const T &lhs, const T &rhs) const
30 return lhs.owner_before(rhs);
32 bool operator()(const T &lhs, const U &rhs) const
34 return lhs.owner_before(rhs);
36 bool operator()(const U &lhs, const T &rhs) const
38 return lhs.owner_before(rhs);
43 template<typename T> struct owner_less;
46 struct owner_less<shared_ptr<T> >:
47 public detail::generic_owner_less<shared_ptr<T>, weak_ptr<T> >
51 struct owner_less<weak_ptr<T> >:
52 public detail::generic_owner_less<weak_ptr<T>, shared_ptr<T> >
57 #endif // #ifndef BOOST_SMART_PTR_OWNER_LESS_HPP_INCLUDED