Title
Unnecessary precondition for is_aggregate
Status
c++23
Section
[meta.unary.prop]
Submitter
Tomasz Kamiński

Created on 2022-11-09.00:00:00 last changed 13 months ago

Messages

Date: 2022-11-17.00:42:33

Proposed resolution:

This wording is relative to N4917.

  1. Modify [meta.type.synop], Table 46 ([tab:meta.unary.prop]) — "Type property predicates" — as indicated:

    Table 48: Type property predicates [tab:meta.unary.prop]
    Template Condition Preconditions
    template<class T, class U>
    struct is_aggregate;
    T is an aggregate type ([dcl.init.aggr]) remove_all_extents_t<T> shall be an array type, a complete type, or cv void.
Date: 2022-11-12.00:00:00

[ 2022-11-12 Approved at November 2022 meeting in Kona. Status changed: Immediate → WP. ]

Date: 2022-11-10.01:10:50

[ Kona 2022-11-09; Move to Immediate ]

Date: 2022-11-09.00:00:00

This is resolution of GB-090 ([meta.unary.prop] Unnecessary precondition for is_aggregate).

The precondition for is_aggregate is "remove_all_extents_t<T> shall be a complete type or cv void." This means that is_aggregate_v<Incomplete[2]> is undefined, but an array is always an aggregate, we don't need a complete element type to know that.

Historically the is_aggregate was introduced by LWG 2911 as part of the resolution of the NB comments. The comment proposed to introduce this trait with requirement "remove_all_extents_t<T> shall be a complete type, an array type, or (possibly cv-qualified) void.", that is close to resolution proposed in this issue. According to notes this was simplified during review, after realizing that remove_all_extents_t<T> is never an array type.

History
Date User Action Args
2023-11-22 15:47:43adminsetstatus: wp -> c++23
2022-11-17 00:42:33adminsetmessages: + msg13098
2022-11-17 00:42:33adminsetstatus: immediate -> wp
2022-11-10 01:10:50adminsetmessages: + msg12983
2022-11-10 01:10:50adminsetstatus: new -> immediate
2022-11-09 21:14:47adminsetstatus: immediate -> new
2022-11-09 04:16:51adminsetmessages: + msg12975
2022-11-09 00:00:00admincreate