Movatterモバイル変換


[0]ホーム

URL:


cppreference.com
Namespaces
Variants
    Actions

      std::pointer_traits<Ptr>::to_address

      From cppreference.com
      <cpp‎ |memory‎ |pointer traits
       
       
      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)
       
      std::pointer_traits
      Member functions
      pointer_traits::to_address
      (C++20)(optional)
       
      Defined in header<memory>
      static element_type* to_address( pointer p)noexcept;
      (since C++20)
      (optional member of program-defined specialization)

      Constructs a raw pointer that references the same object as its pointer-like ("fancy pointer") argument.

      This function, if defined, is the inverse ofpointer_to, and exists as the customization point to be called bystd::to_address.

      [edit]Parameters

      p - fancy pointer/pointer-like object

      [edit]Return value

      A raw pointer of the typeelement_type* that references the same memory location as the argumentp.

      [edit]See also

      [static]
      obtains a dereferenceable pointer to its argument
      (public static member function)[edit]
      (C++20)
      obtains a raw pointer from a pointer-like type
      (function template)[edit]
      Retrieved from "https://en.cppreference.com/mwiki/index.php?title=cpp/memory/pointer_traits/to_address&oldid=153372"

      [8]ページ先頭

      ©2009-2026 Movatter.jp