owner_hash.hpp 566 B

123456789101112131415161718192021222324252627
  1. #ifndef BOOST_SMART_PTR_OWNER_HASH_HPP_INCLUDED
  2. #define BOOST_SMART_PTR_OWNER_HASH_HPP_INCLUDED
  3. // Copyright 2020 Peter Dimov
  4. // Distributed under the Boost Software License, Version 1.0.
  5. // https://www.boost.org/LICENSE_1_0.txt
  6. #include <cstddef>
  7. namespace boost
  8. {
  9. template<class T> struct owner_hash
  10. {
  11. typedef std::size_t result_type;
  12. typedef T argument_type;
  13. std::size_t operator()( T const & t ) const noexcept
  14. {
  15. return t.owner_hash_value();
  16. }
  17. };
  18. } // namespace boost
  19. #endif // #ifndef BOOST_SMART_PTR_OWNER_HASH_HPP_INCLUDED