Skip to content

DPL: use C++26 extension to expand packs where available#15631

Open
ktf wants to merge 1 commit into
AliceO2Group:devfrom
ktf:pr15631
Open

DPL: use C++26 extension to expand packs where available#15631
ktf wants to merge 1 commit into
AliceO2Group:devfrom
ktf:pr15631

Conversation

@ktf

@ktf ktf commented Jul 23, 2026

Copy link
Copy Markdown
Member

O(1) in both CPU and time rather than O(N) when compiling the pack expansion.

Removes the limit to 100 elements in a struct.

Requires XCode 26.4

@ktf

ktf commented Jul 23, 2026

Copy link
Copy Markdown
Member Author

@aalkin not sure I would merge this just yet, however it seems to work as desired... :-)

if constexpr (sizeof...(members) == 0) {
return std::array<bool, 0>();
} else {
return std::array<detail::first_t<decltype(l(members))...>, sizeof...(members)>{l(members)...};

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

You can skip the array's template parameters, they should be deducible from the initializer list

@aalkin

aalkin commented Jul 23, 2026

Copy link
Copy Markdown
Member

If we switch to clang as a primary compiler for O2Physics, this will work not only on mac.

O(1) in both CPU and time rather than O(N) when compiling the pack expansion.

Removes the limit to 100 elements in a struct.

Requires XCode 26.4
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

2 participants