This page is a snapshot from the LWG issues list, see the Library Active Issues List for more information and the meaning of New status.

3167. [fund.ts.v3] Does observer_ptr support function types?

Section: 5.2 [fund.ts.v3::memory.observer.ptr] Status: New Submitter: Alisdair Meredith Opened: 2018-11-14 Last modified: 2018-12-01

Priority: 3

View all issues with New status.

Discussion:

Addresses: fund.ts.v3

From the wording, function pointers are never clearly considered. P1 infers support for only objects, but it is not clear that wording is intended to be a deliberate restriction, or is casual wording.

Paragraph 2 mandates that we cannot instantiate for reference types, and do support incomplete types, but still does not consider function types. Calling out references specifically, as they are not object types, suggests the inferred support for only objects in p1 is more a case of casual phrasing, than deliberate intent.

However, if we did intend to support function pointers, we may want to consider adding a function-call operator, constrained to supporting pointer-to function types. One other possibility is that the explicit conversion to pointer already serves that purpose, although I need to double-check the core language that contextual conversions to function pointer are considered when invoking the function call operator. If this is the case, then I suggest a note to that effect in [memory.observer.ptr.conv] instead.

[2018-11 Reflector prioritization]

Set Priority to 3

Proposed resolution: