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

Add for_each_extents example #247

Open
wants to merge 5 commits into
base: stable
Choose a base branch
from

Conversation

mhoemmen
Copy link
Contributor

@mhoemmen mhoemmen commented Mar 21, 2023

Add for_each_extents examples as two separate files. This addresses common user questions about mdspan iteration, expressed in issues such as #202.

The first example relies on std::views::cartesian_product and std::views::iota, which are C++23 features that only GCC 13 currently implements. The second example does not use ranges at all, but it does depend on lambdas being able to accept an explicit template parameter list, a C++20 feature. The example could be rewritten not to depend on that, but it would be more verbose and generally less useful as an example in that case. Both examples use macros to skip compilation in case the required features are not available.

@mhoemmen mhoemmen force-pushed the Add-for-each-extents-example branch from b11eec3 to 398b5db Compare March 21, 2023 16:45
@mhoemmen mhoemmen force-pushed the Add-for-each-extents-example branch from 59c81e8 to 457b822 Compare April 2, 2024 22:26
@mhoemmen mhoemmen requested review from nmm0 and crtrott April 2, 2024 22:28
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.

None yet

2 participants