Summary
Two C++17 preparatory steps toward C++26 auto-reflection of compound structs.
Step 1 — access_traits_t for plain aggregates
Removing compiler_meta_t (PR #255) left access_traits_t<pod_t> falling through
to unsupported. Writing a scalar compound works today only because tests route
through vector<pod_t> (pointers path). Once C++26 storage_traits_impl_t fires
for an aggregate, the write dispatcher needs a matching access_traits_t for the
scalar case.
Add a partial specialisation gated on std::is_aggregate_v<T> with exclusions for
arithmetic, array-like, and text-like types. kind = access_t::object;
is_trivially_packable = std::is_trivially_copyable_v<T>.
Step 2 — is_transport_contiguous for trivially copyable aggregates
is_transport_contiguous_v<pod_t> is currently false — vector<pod_t> uses the
element-copy pointers path instead of bulk memcpy. Any aggregate where
std::is_trivially_copyable_v<T> is true is safe to bulk-transfer. Add a partial
specialisation of is_transport_contiguous_impl_t for that case.
This is a real performance improvement independent of reflection.
Out of scope
- CI lane for
-freflection (separate issue)
storage_traits_impl_t under __cpp_reflection (Step 3, separate PR)
Summary
Two C++17 preparatory steps toward C++26 auto-reflection of compound structs.
Step 1 —
access_traits_tfor plain aggregatesRemoving
compiler_meta_t(PR #255) leftaccess_traits_t<pod_t>falling throughto
unsupported. Writing a scalar compound works today only because tests routethrough
vector<pod_t>(pointers path). Once C++26storage_traits_impl_tfiresfor an aggregate, the write dispatcher needs a matching
access_traits_tfor thescalar case.
Add a partial specialisation gated on
std::is_aggregate_v<T>with exclusions forarithmetic, array-like, and text-like types.
kind = access_t::object;is_trivially_packable = std::is_trivially_copyable_v<T>.Step 2 —
is_transport_contiguousfor trivially copyable aggregatesis_transport_contiguous_v<pod_t>is currentlyfalse—vector<pod_t>uses theelement-copy
pointerspath instead of bulkmemcpy. Any aggregate wherestd::is_trivially_copyable_v<T>is true is safe to bulk-transfer. Add a partialspecialisation of
is_transport_contiguous_impl_tfor that case.This is a real performance improvement independent of reflection.
Out of scope
-freflection(separate issue)storage_traits_impl_tunder__cpp_reflection(Step 3, separate PR)