Skip to content

[struct_pack] fix c++17 add std::array to continuous_container to match C++20 behavior#1164

Merged
poor-circle merged 1 commit into
alibaba:mainfrom
songqing:fix/continuous-container-std-array
Apr 3, 2026
Merged

[struct_pack] fix c++17 add std::array to continuous_container to match C++20 behavior#1164
poor-circle merged 1 commit into
alibaba:mainfrom
songqing:fix/continuous-container-std-array

Conversation

@songqing

@songqing songqing commented Apr 1, 2026

Copy link
Copy Markdown
Contributor

Why

Issue: The C++17 version only hard-codes recognition of std::vector and std::basic_string, while std::array (which has a contiguous memory layout) is completely ignored. In C++20, using std::span{container} correctly recognizes all contiguous containers. This causes std::array<TrivialType, N> to miss the fast bulk memory copy path in C++17 mode, leading to worse serialization performance and behavior that is inconsistent with the C++20 version.

What is changing

Example

@CLAassistant

CLAassistant commented Apr 1, 2026

Copy link
Copy Markdown

CLA assistant check
All committers have signed the CLA.

@songqing songqing force-pushed the fix/continuous-container-std-array branch from cb0f408 to 2e5f1ad Compare April 1, 2026 00:55
@github-actions

github-actions Bot commented Apr 1, 2026

Copy link
Copy Markdown

for detail, goto summary download Artifacts base-ylt-cov-report(base commit coverage report) and ylt-cov-report(current pull request coverage report)

@github-actions

github-actions Bot commented Apr 1, 2026

Copy link
Copy Markdown

for detail, goto summary download Artifacts base-ylt-cov-report(base commit coverage report) and ylt-cov-report(current pull request coverage report)

@poor-circle

Copy link
Copy Markdown
Collaborator

LGTM

@poor-circle poor-circle merged commit 9dcaa89 into alibaba:main Apr 3, 2026
29 of 31 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants