Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added arrayForEachDim method to simplify template metaprogramming. #171

Merged
merged 2 commits into from
Jan 30, 2024

Conversation

odlomax
Copy link
Contributor

@odlomax odlomax commented Jan 25, 2024

This PR adds the following method to src/atlas/array/helpers/ArrayForEach.h:

/// brief   Construct ArrayForEach and call apply
///
/// details Construct an ArrayForEach<ItrDims...> using std::integer_sequence
///         <int, ItrDims...>. Remaining arguments are forwarded to apply
///         method.
template <int... ItrDims, typename... Args>
void arrayForEachDim(std::integer_sequence<int, ItrDims...>, Args&&... args) {
  ArrayForEach<ItrDims...>::apply(std::forward<Args>(args)...);
}

Relevant tests are added to src/tests/array/test_array_foreach.cc.

This feature supports #168 and should be merged beforehand.

Copy link
Member

@wdeconinck wdeconinck left a comment

Choose a reason for hiding this comment

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

Great, no comments :)

@wdeconinck wdeconinck merged commit 8780370 into ecmwf:develop Jan 30, 2024
20 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants