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

45 lines
1.3 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.traits.optmem]
# 20 Memory management library [[mem]](./#mem)
## 20.2 Memory [[memory]](memory#pointer.traits.optmem)
### 20.2.3 Pointer traits [[pointer.traits]](pointer.traits#optmem)
#### 20.2.3.4 Optional members [pointer.traits.optmem]
[1](#1)
[#](http://github.com/Eelis/draft/tree/9adde4bc1c62ec234483e63ea3b70a59724c745a/source/memory.tex#L882)
Specializations of pointer_traits may define the member declared
in this subclause to customize the behavior of the standard library[.](#1.sentence-1)
A specialization generated from the pointer_traits primary template
has no member by this name[.](#1.sentence-2)
[🔗](#lib:to_address,pointer_traits)
`static element_type* to_address(pointer p) noexcept;
`
[2](#2)
[#](http://github.com/Eelis/draft/tree/9adde4bc1c62ec234483e63ea3b70a59724c745a/source/memory.tex#L894)
*Returns*: A pointer of type element_type* that references
the same location as the argument p[.](#2.sentence-1)
[3](#3)
[#](http://github.com/Eelis/draft/tree/9adde4bc1c62ec234483e63ea3b70a59724c745a/source/memory.tex#L899)
[*Note [1](#note-1)*:
This function is intended to be the inverse of pointer_to[.](#3.sentence-1)
If defined, it customizes the behavior of
the non-member functionto_address ([[pointer.conversion]](pointer.conversion "20.2.4Pointer conversion"))[.](#3.sentence-2)
— *end note*]