P3856R5 — New reflection metafunction - is_structural_type (US NB comment 49) (7 items) LEWG/LWG
Jagrut Dave, Alisdair Meredith
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 in [temp.param]. The absence of such a facility is inconsistent with existing library mandates that require types to be structural, leaving users without a portable way to perform this check. A proof-of-concept implementation using P2996 reflection metafunctions is provided, demonstrating that the functionality can be approximated with existing reflection primitives while also highlighting gaps such as missing is_constexpr and is_literal_type metafunctions.

References — Anthropic Citations API

[1]
"template requires is_structural_v struct const_wrapper { static constexpr auto value = V; };"
[2]
"template requires is_structural_type_v inline void log_event() { /* Tag is known to be NTTP */ }"
[3] chars 3532–3688
"template requires is_structural_type_v inline void log_event() { /* Tag is known to be NTTP */ } // Fall back, run-time. "
[3] chars 3532–3688
"template requires is_structural_type_v inline void log_event() { /* Tag is known to be NTTP */ } // Fall back, run-time. "
[4] chars 16480–18140
"21.4 Reflection [meta.reflection] 21.4.1 Header synopsis [meta.syn] … // associated with [meta.unary.prop], type properties ... consteval bool is_consteval_only_type(info type);..."
[4] chars 16480–18140
"21.4 Reflection [meta.reflection] 21.4.1 Header synopsis [meta.syn] … // associated with [meta.unary.prop], type properties ... consteval bool is_consteval_only_type(info type);..."
[5]
"3.1.2 Proof of concept implementation 3.3 Observations from the sample implementation"
[6]
"[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"
Summary: P3856R5 proposes adding a reflection metafunction is_structural_v (and its type trait is_structural) to determine whether a type can be used as a non-type template parameter. It provides proposed wording for inclusion in the header and the [meta.unary.prop] table.
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.