Movatterモバイル変換


[0]ホーム

URL:


cppreference.com
Namespaces
Variants
    Actions

      std::hash<std::indirect>

      From cppreference.com
      <cpp‎ |memory‎ |indirect
       
       
      Memory management library
      (exposition only*)
      Allocators
      Uninitialized memory algorithms
      Constrained uninitialized memory algorithms
      Memory resources
      Uninitialized storage(until C++20)
      (until C++20*)
      (until C++20*)
      Garbage collector support(until C++23)
      (C++11)(until C++23)
      (C++11)(until C++23)
      (C++11)(until C++23)
      (C++11)(until C++23)
      (C++11)(until C++23)
      (C++11)(until C++23)
       
       
      Defined in header<memory>
      template<class T,class Allocator>
      struct hash<std::indirect<T, Allocator>>;
      (since C++26)

      The partial specialization ofstd::hash forstd::indirect allows users to obtain hashes of the objects owned byindirect objects.

      The specializationstd::hash<std::indirect<T, Allocator>> isenabled ifstd::hash<T> is enabled, and is disabled otherwise.

      When enabled, for an objectobj of typestd::indirect<T, Allocator>,std::hash<std::indirect<T, Allocator>>()(obj) evaluates to:

      • std::hash<T>()(*obj), ifobj is notvalueless.
      • An implementation-defined value, ifobj is valueless.

      The member functions of this specialization are not guaranteed to benoexcept because the hash ofT might throw.

      [edit]Example

      This section is incomplete
      Reason: no example

      [edit]See also

      (C++11)
      hash function object
      (class template)[edit]
      Retrieved from "https://en.cppreference.com/mwiki/index.php?title=cpp/memory/indirect/hash&oldid=182620"

      [8]ページ先頭

      ©2009-2025 Movatter.jp