owner_hash.hpp 600 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 <boost/config.hpp>
  7. #include <cstddef>
  8. namespace boost
  9. {
  10. template<class T> struct owner_hash
  11. {
  12. typedef std::size_t result_type;
  13. typedef T argument_type;
  14. std::size_t operator()( T const & t ) const BOOST_NOEXCEPT
  15. {
  16. return t.owner_hash_value();
  17. }
  18. };
  19. } // namespace boost
  20. #endif // #ifndef BOOST_SMART_PTR_OWNER_HASH_HPP_INCLUDED