Chris@16: #ifndef BOOST_SMART_PTR_OWNER_LESS_HPP_INCLUDED Chris@16: #define BOOST_SMART_PTR_OWNER_LESS_HPP_INCLUDED Chris@16: Chris@16: // Chris@16: // owner_less.hpp Chris@16: // Chris@16: // Copyright (c) 2008 Frank Mori Hess Chris@16: // Chris@16: // Distributed under the Boost Software License, Version 1.0. (See Chris@16: // accompanying file LICENSE_1_0.txt or copy at Chris@16: // http://www.boost.org/LICENSE_1_0.txt) Chris@16: // Chris@16: // See http://www.boost.org/libs/smart_ptr/smart_ptr.htm for documentation. Chris@16: // Chris@16: Chris@16: #include Chris@16: Chris@16: namespace boost Chris@16: { Chris@16: template class shared_ptr; Chris@16: template class weak_ptr; Chris@16: Chris@16: namespace detail Chris@16: { Chris@16: template Chris@16: struct generic_owner_less : public std::binary_function Chris@16: { Chris@16: bool operator()(const T &lhs, const T &rhs) const Chris@16: { Chris@16: return lhs.owner_before(rhs); Chris@16: } Chris@16: bool operator()(const T &lhs, const U &rhs) const Chris@16: { Chris@16: return lhs.owner_before(rhs); Chris@16: } Chris@16: bool operator()(const U &lhs, const T &rhs) const Chris@16: { Chris@16: return lhs.owner_before(rhs); Chris@16: } Chris@16: }; Chris@16: } // namespace detail Chris@16: Chris@16: template struct owner_less; Chris@16: Chris@16: template Chris@16: struct owner_less >: Chris@16: public detail::generic_owner_less, weak_ptr > Chris@16: {}; Chris@16: Chris@16: template Chris@16: struct owner_less >: Chris@16: public detail::generic_owner_less, shared_ptr > Chris@16: {}; Chris@16: Chris@16: } // namespace boost Chris@16: Chris@16: #endif // #ifndef BOOST_SMART_PTR_OWNER_LESS_HPP_INCLUDED