std::allocator<T>::address
來自 cppreference.com
(1) | ||
pointer address( reference x ) const; |
(C++11 前) | |
pointer address( reference x ) const noexcept; |
(C++11 起) (C++17 中已棄用) (C++20 中移除) |
|
(2) | ||
const_pointer address( const_reference x ) const; |
(C++11 前) | |
const_pointer address( const_reference x ) const noexcept; |
(C++11 起) (C++17 中已棄用) (C++20 中移除) |
|
返回 x 的實際地址,即使存在過載的 operator&。
[編輯] 引數
x | - | 要獲取地址的物件 |
[編輯] 返回值
x 的實際地址。
[編輯] 缺陷報告
下列更改行為的缺陷報告追溯地應用於以前出版的 C++ 標準。
缺陷報告 | 應用於 | 釋出時的行為 | 正確的行為 |
---|---|---|---|
LWG 634 (N2436) |
C++98 | 返回值為 &x (受過載 operator& 的影響) |
返回 x 的實際地址 |