Files
cppdraft_translate/cppdraft/specialized/addressof.md
2025-10-25 03:02:53 +03:00

27 lines
840 B
Markdown
Raw Blame History

This file contains invisible Unicode characters

This file contains invisible Unicode characters that are indistinguishable to humans but may be processed differently by a computer. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

[specialized.addressof]
# 20 Memory management library [[mem]](./#mem)
## 20.2 Memory [[memory]](memory#specialized.addressof)
### 20.2.11 addressof [specialized.addressof]
[🔗](#lib:addressof)
`template<class T> constexpr T* addressof(T& r) noexcept;
`
[1](#1)
[#](http://github.com/Eelis/draft/tree/9adde4bc1c62ec234483e63ea3b70a59724c745a/source/memory.tex#L2117)
*Returns*: The actual address of the object or function referenced by r, even in the
presence of an overloaded operator&[.](#1.sentence-1)
[2](#2)
[#](http://github.com/Eelis/draft/tree/9adde4bc1c62ec234483e63ea3b70a59724c745a/source/memory.tex#L2122)
*Remarks*: An expression addressof(E) is a constant subexpression ([[defns.const.subexpr]](defns.const.subexpr "3.15constant subexpression"))
if E is an lvalue constant subexpression[.](#2.sentence-1)