You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
A prvalue of type “pointer to noexcept function” can be converted to a prvalue of type “pointer to function”. The result is a pointer to the function.
Presumably, the definition works if and only if such two pointers point to the same function type except for exception specification. In the current wording, we seem not to give the restriction to the function types in the establishment of the conversion.
Suggested resolution
A prvalue of type “pointer to function type T” can be converted to a prvalue of type “pointer to function type U” where T and U are the same function type except that T has a non-throwing exception specification and U has a potentially-throwing exception specification. The result is a pointer to the function.
The same is true for the pointer to member function conversion.
In the current examples, the listed case is a bit irrelevant to the conversion
void (*p)();
void (**pp)() noexcept = &p; // error: cannot convert to pointer to noexcept function
The definition works only if we have a "pointer to function type" rather than "pointer to pointer to function type". Even though, the example would be
[conv.fctptr] p1 says
Presumably, the definition works if and only if such two pointers point to the same function type except for exception specification. In the current wording, we seem not to give the restriction to the function types in the establishment of the conversion.
Suggested resolution
The same is true for the pointer to member function conversion.
In the current examples, the listed case is a bit irrelevant to the conversion
The definition works only if we have a "pointer to function type" rather than "pointer to pointer to function type". Even though, the example would be
The relevant example should be changed to
The text was updated successfully, but these errors were encountered: