Skip to content

support c-style arrays#189

Open
dchinmay2 wants to merge 1 commit intoboostorg:developfrom
dchinmay2:c-array
Open

support c-style arrays#189
dchinmay2 wants to merge 1 commit intoboostorg:developfrom
dchinmay2:c-array

Conversation

@dchinmay2
Copy link
Copy Markdown

this tries to implement the solution in #170, with one change: I saw some "must be aggregate initializable" errors so I added another case depending on std::is_aggregate_v<T>

@dchinmay2
Copy link
Copy Markdown
Author

the tests still fail though:
test.log

@yrashk
Copy link
Copy Markdown

yrashk commented Oct 21, 2024

Very interested in seeing this through, let me know if I can help in any way!

@apolukhin
Copy link
Copy Markdown
Member

the tests still fail though:

std::is_aggregate is not available in C++14, but just ignore that issue for now. Make sure that the PR builds in С++20 or C++17 mode. Any modern enough compiler is fine for that, clang-18 is fine.

Nagisaaaaaaaaa added a commit to Nagisaaaaaaaaa/ARIA that referenced this pull request Feb 6, 2025
1. Support C arrays as `MosaicPattern` members.
1.1. Use the fixed `boost::pfr` to support C arrays, see boostorg/pfr#189.
1.2. Extend the `Mosaic` system to support C arrays as `MosaicPattern` members.
1.3. Check `boost::pfr` limitations and undefined behaviors at compile time.
2. Add policy-based `Vector` which supports auto SoA.
2.1. Implemented with type reduction.
2.2. Fully test compatibility with different `Mosaic`s, including `Vec<T, size>`.
};

template <class T, std::size_t I0, std::size_t... I, class /*Enable*/ = std::enable_if_t<std::is_copy_constructible<T>::value>>
template <class T, std::size_t I0, std::size_t... I, class /*Enable*/ = std::enable_if_t<std::is_copy_constructible<T>::value and !std::is_aggregate_v<T>>>
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

please provide unit-test to check that boost::pfr::tuple_size for a structure with c-style array field returns real count of fields

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.

4 participants