Skip to content

refactor, access_traits_t and is_transport_contiguous for plain aggregates #256

@steven-varga

Description

@steven-varga

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 falsevector<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)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions