owner_less.hpp 809 B

12345678910111213141516171819202122232425262728293031323334
  1. #ifndef BOOST_SMART_PTR_OWNER_LESS_HPP_INCLUDED
  2. #define BOOST_SMART_PTR_OWNER_LESS_HPP_INCLUDED
  3. //
  4. // owner_less.hpp
  5. //
  6. // Copyright (c) 2008 Frank Mori Hess
  7. // Copyright (c) 2016 Peter Dimov
  8. //
  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)
  12. //
  13. // See http://www.boost.org/libs/smart_ptr/ for documentation.
  14. //
  15. namespace boost
  16. {
  17. template<class T = void> struct owner_less
  18. {
  19. typedef bool result_type;
  20. typedef T first_argument_type;
  21. typedef T second_argument_type;
  22. template<class U, class V> bool operator()( U const & u, V const & v ) const
  23. {
  24. return u.owner_before( v );
  25. }
  26. };
  27. } // namespace boost
  28. #endif // #ifndef BOOST_SMART_PTR_OWNER_LESS_HPP_INCLUDED