P3856R4 — New reflection metafunction - is_structural_type (US NB comment 49)
(7 items)
LEWG/LWG
This paper proposes adding a new reflection metafunction is_structural_type(info) to the header and a corresponding type trait is_structural to , allowing users to query whether a type is a structural type as defined by [temp.param]. Currently, the standard mandates structural types in several library contexts but provides no user-accessible mechanism to check this property. The paper provides a proof-of-concept implementation using P2996 reflection metafunctions and includes full library wording for both the metafunction and type trait.
-
Section 5, [meta.unary.prop] table (page 13) — is_structural has no precondition, but determining structural-type status requires inspecting bases and data members of a complete type. Peer traits such as is_consteval_only specify "remove_all_extents_t
shall be a complete type or cv void"; is_structural needs the same. [1] -
Section 3.1.1 (page 3) vs. Section 5 (page 13) — Motivating examples use is_structural_type_v
throughout, but the proposed wording defines the variable template as is_structural_v. The names do not match. [2] - Table of Contents / Section 3 (pages 1-10) — Section numbering jumps from 3.1.2 to 3.3, skipping 3.2 entirely. Likely a remnant of removing is_destructurable_type without renumbering. [3]
- Section 5 (page 12), instruction text before [meta.type.synop] — "is_structual" is misspelled; should be "is_structural". [4]
- Section 8, References (page 14) — Bibliography entry labeled P2996R13 links to https://wg21.link/p2996r9, pointing to revision 9 instead of revision 13. [5]
References — Anthropic Citations API
[1]
"requires is_structural_type_v" vs. (wording) "constexpr bool is_structural_v = is_structural::value;"
"requires is_structural_type_v
[2]
"None C/C++ template>
consteval bool is_constructible_type(info type, R&&
type_args);
...
Add a new metafunction is_structural_type to 21.4.17..."
"None C/C++ template
[2]
"None C/C++ template>
consteval bool is_constructible_type(info type, R&&
type_args);
...
Add a new metafunction is_structural_type to 21.4.17..."
"None C/C++ template
[3]
"[P2996R13] Barry Revzin, Wyatt Childers, Peter Dimov, Andrew Sutton, Faisal Vali, Daveed Vandevoorde, Dan Katz. 2025-01-13. Reflection for C++26. https://wg21.link/p2996r9"
"[P2996R13] Barry Revzin, Wyatt Childers, Peter Dimov, Andrew Sutton, Faisal Vali, Daveed Vandevoorde, Dan Katz. 2025-01-13. Reflection for C++26. https://wg21.link/p2996r9"
[4]
"3.1.2 Proof of concept implementation" ... "3.3 Observations from the sample implementation"
"3.1.2 Proof of concept implementation" ... "3.3 Observations from the sample implementation"
[5]
"None C/C++ template>
consteval bool is_constructible_type(info type, R&&
type_args);
...
Add a new metafunction is_structural_type to 21.4.17..."
"None C/C++ template
[5]
"None C/C++ template>
consteval bool is_constructible_type(info type, R&&
type_args);
...
Add a new metafunction is_structural_type to 21.4.17..."
"None C/C++ template
Summary: P3856R4 proposes adding a new type trait is_structural to the header and a corresponding is_structural_type reflection metafunction, enabling compile-time queries for whether a type satisfies the structural type requirements needed for use as a non-type template parameter. Five defects were found spanning naming inconsistencies, a missing precondition, a misspelling, a broken section numbering, and an incorrect bibliography URL.
Pipeline: Discovery (Anthropic Opus + Citations API) → Verification Gate (OpenRouter Opus) → Report Writer (OpenRouter Opus)
Provenance: All references are machine-verified character positions from the Anthropic Citations API — deterministic, exact substrings, not model-generated quotes.
Provenance: All references are machine-verified character positions from the Anthropic Citations API — deterministic, exact substrings, not model-generated quotes.