Title
Simplify type trait wording
Status
nad
Section
[meta]
Submitter
Alisdair Meredith

Created on 2023-05-01.00:00:00 last changed 11 months ago

Messages

Date: 2023-06-01.14:21:36

Proposed resolution:

This wording is relative to N4944.

  1. Throughout [meta] replace all occurrences of

    T shall be a complete type, cv void, or an array of unknown bound.

    by

    T shall not be an incomplete class type.

Date: 2023-06-15.00:00:00

[ 2023-06-01; Reflector poll ]

Set status to Tentatively NAD after four votes in favour during reflector poll, including a request to withdraw the issue from the submitter.

Incomplete enumeration types are found within the enum-specifier of an enum without a fixed underlying type:


enum E {
    A = sizeof(E) // error, E is incomplete at this point
};
and we definitely can't provide an underlying type for this case.

Date: 2023-05-01.00:00:00

There are many traits that have a requirement that they are instantiated only if "T shall be a complete type, cv void, or an array of unknown bound."

Breaking down what this means, by supporting cv-void and arrays of unknown bound (almost) the only remaining type-category is incomplete class types.

The remaining edge case is incomplete enumerations, but they are required to have a known fixed-base, so act as complete types, they can be copied, assigned, etc., without knowing the names of their enumerators.

Hence, I suggest clearer wording would be: "T shall not be an incomplete class type."

This is easier to understand, as we do not need to mentally enumerate every type against a list to check it qualifies; it is a simpler test for the library to check if we were to mandate these restrictions.

There are a very small number of traits with subtly different wording, where incomplete unions are supported, or arrays of unknown bound are not a concern due to invoking remove_all_extents first. The bulk of the changes can be made to traits with only the precise wording above though, and then we can review whether any of the remaining restrictions deserve a wording update of their own.

History
Date User Action Args
2023-06-01 14:21:36adminsetmessages: + msg13606
2023-06-01 14:21:36adminsetstatus: new -> nad
2023-05-06 15:53:04adminsetmessages: + msg13542
2023-05-01 00:00:00admincreate