Created on 2024-06-25.00:00:00 last changed 3 weeks ago
Proposed resolution:
This wording is relative to N4981.
Modify [meta.unary.prop] as indicated:
Template Condition Preconditions … … … template<class T> struct has_unique_object_representations;
For an array type `T`, the same result as has_unique_object_representations_v<remove_all_extents_t<T>>
, otherwise see below.remove_all_extents_t<T>
shall be a complete typeT
,or cv `void`, or an array of unknown bound.
[Drafting note: We could use
remove_extent_t<T>
to remove just the first array dimension, because only that first one can have an unknown bound. The proposed resolution usesremove_all_extents_t<T>
for consistency with the Condition column.]
[ Wrocław 2024-11-23; Status changed: Voting → WP. ]
[ 2024-08-02; Reflector poll ]
Set status to Tentatively Ready after nine votes in favour during reflector poll.
The type completeness requirements for `has_unique_object_representations` say:
`T` shall be a complete type, cv `void`, or an array of unknown bound.
This implies that the trait works for all arrays of unknown bound,
whether the element type is complete or not. That seems to be incorrect,
because has_unique_object_representations_v<Incomplete[]>
is required to have the same result as
has_unique_object_representations_v<Incomplete>
which is ill-formed if `Incomplete` is an incomplete class type.
I think we need the element type to be complete to be able to give an answer. Alternatively, if the intended result for an array of unknown bound is false (maybe because there can be no objects of type `T[]`, or because we can't know that two objects declared as `extern T a[];` and `extern T b[];` have the same number of elements?) then the condition for the trait needs to be special-cased as `false` for arrays of unknown bound. The current spec is inconsistent, we can't allow arrays of unknown bound and apply the current rules to determine the trait's result.
History | |||
---|---|---|---|
Date | User | Action | Args |
2024-11-28 21:40:31 | admin | set | messages: + msg14483 |
2024-11-28 21:40:31 | admin | set | status: voting -> wp |
2024-11-19 16:09:07 | admin | set | status: ready -> voting |
2024-08-02 21:32:21 | admin | set | messages: + msg14286 |
2024-08-02 21:32:21 | admin | set | status: new -> ready |
2024-06-25 17:20:07 | admin | set | messages: + msg14216 |
2024-06-25 00:00:00 | admin | create |