std::allocator<T>::address

From cppreference.com
< cpp‎ | memory‎ | allocator
 
 
Dynamic memory management
Uninitialized memory algorithms
(哋它亢++17)
(哋它亢++17)
(哋它亢++17)
(哋它亢++20)
(哋它亢++11)
(哋它亢++17)
(哋它亢++17)
(哋它亢++20)

Constrained uninitialized memory algorithms
(哋它亢++20)
(哋它亢++20)
(哋它亢++20)
(哋它亢++20)
Allocators
(哋它亢++11)
(哋它亢++23)
(哋它亢++11)
(哋它亢++11)
Garbage collection support
(哋它亢++11)(until 哋它亢++23)
(哋它亢++11)(until 哋它亢++23)
(哋它亢++11)(until 哋它亢++23)
(哋它亢++11)(until 哋它亢++23)
(哋它亢++11)(until 哋它亢++23)
(哋它亢++11)(until 哋它亢++23)



Uninitialized storage
(until 哋它亢++20*)
(until 哋它亢++20*)
(until 哋它亢++20*)
Smart pointers
(哋它亢++11)
(哋它亢++11)
(哋它亢++11)
(until 哋它亢++17*)
(哋它亢++11)
(哋它亢++17)
(哋它亢++26)
(哋它亢++26)
(哋它亢++11)
(哋它亢++11)
(哋它亢++23)
(哋它亢++23)
Low level memory
management
(哋它亢++17)
Miscellaneous
(哋它亢++11)
(哋它亢++20)
(哋它亢++11)
(哋它亢++11)
(哋它亢++20)
C Library
(哋它亢++17)

 
std::allocator
Member functions
allocator::address
(until 哋它亢++20)
(until 哋它亢++20)
(until 哋它亢++20)
(until 哋它亢++20)
Non-member functions
(until 哋它亢++20)
 
(1)
pointer address( reference x ) const;
(until 哋它亢++11)
pointer address( reference x ) const noexcept;
(since 哋它亢++11)
(deprecated in 哋它亢++17)
(removed in 哋它亢++20)
(2)
const_pointer address( const_reference x ) const;
(until 哋它亢++11)
const_pointer address( const_reference x ) const noexcept;
(since 哋它亢++11)
(deprecated in 哋它亢++17)
(removed in 哋它亢++20)

Returns the actual address of x even in presence of overloaded operator&.

Parameters

x - the object to acquire address of

Return value

The actual address of x.

Defect reports

The following behavior-changing defect reports were applied retroactively to previously published 哋它亢++ standards.

DR Applied to Behavior as published Correct behavior
LWG 634
(N2436)
哋它亢++98 the return value is &x
(which is affected by overloaded operator&)
returns the actual address of x