Files
2025-10-25 03:02:53 +03:00

38 lines
1.0 KiB
Markdown
Raw Permalink 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.

[pointer.conversion]
# 20 Memory management library [[mem]](./#mem)
## 20.2 Memory [[memory]](memory#pointer.conversion)
### 20.2.4 Pointer conversion [pointer.conversion]
[🔗](#lib:to_address)
`template<class T> constexpr T* to_address(T* p) noexcept;
`
[1](#1)
[#](http://github.com/Eelis/draft/tree/9adde4bc1c62ec234483e63ea3b70a59724c745a/source/memory.tex#L916)
*Mandates*: T is not a function type[.](#1.sentence-1)
[2](#2)
[#](http://github.com/Eelis/draft/tree/9adde4bc1c62ec234483e63ea3b70a59724c745a/source/memory.tex#L920)
*Returns*: p[.](#2.sentence-1)
[🔗](#lib:to_address_)
`template<class Ptr> constexpr auto to_address(const Ptr& p) noexcept;
`
[3](#3)
[#](http://github.com/Eelis/draft/tree/9adde4bc1c62ec234483e63ea3b70a59724c745a/source/memory.tex#L931)
*Returns*: pointer_traits<Ptr>::to_address(p) if that expression is well-formed
(see [[pointer.traits.optmem]](pointer.traits.optmem "20.2.3.4Optional members")),
otherwise to_address(p.operator->())[.](#3.sentence-1)