[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.4 Optional members")),
otherwise to_address(p.operator->())[.](#3.sentence-1)
