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

24 lines
1002 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.

[conv.fctptr]
# 7 Expressions [[expr]](./#expr)
## 7.3 Standard conversions [[conv]](conv#fctptr)
### 7.3.14 Function pointer conversions [conv.fctptr]
[1](#1)
[#](http://github.com/Eelis/draft/tree/9adde4bc1c62ec234483e63ea3b70a59724c745a/source/expressions.tex#L1129)
A prvalue of type “pointer to noexcept function”
can be converted to a prvalue of type “pointer to function”[.](#1.sentence-1)
The result is a pointer to the function[.](#1.sentence-2)
A prvalue of type “pointer to member of type noexcept function”
can be converted to a prvalue of type “pointer to member of type function”[.](#1.sentence-3)
The result designates the member function[.](#1.sentence-4)
[*Example [1](#example-1)*: void (*p)();void (**pp)() noexcept = &p; // error: cannot convert to pointer to noexcept functionstruct S { typedef void (*p)(); operator p(); };void (*q)() noexcept = S(); // error: cannot convert to pointer to noexcept function — *end example*]