Scroll to navigation

std::allocator::address(3) C++ Standard Libary std::allocator::address(3)

NAME

std::allocator::address - std::allocator::address

Synopsis


pointer address( reference x ) (until C++11)
const;
pointer address( reference x ) (since C++11)
const noexcept; (deprecated in C++17)
(removed in C++20)
const_pointer address( (1) (until C++11)
const_reference x ) const;
const_pointer address( (2) (since C++11)
const_reference x ) const (deprecated in
noexcept; C++17)
(removed in C++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 C++ standards.


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

2024.06.10 http://cppreference.com