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

Allow for structured bindings from const camp::tuple #140

Merged
merged 4 commits into from
Oct 17, 2023

Conversation

rrsettgast
Copy link
Contributor

@rrsettgast rrsettgast commented Oct 16, 2023

closes #139

test/tuple.cpp Outdated Show resolved Hide resolved
test/tuple.cpp Outdated
Comment on lines 406 to 407
// a = 4;
// b = 10.1;
Copy link
Contributor Author

Choose a reason for hiding this comment

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

@trws Do you have a preferred method for testing that compilations fail, or are you ok not testing? I don't think you can protect yourself fully given the tuple of references behavior?

Copy link
Member

Choose a reason for hiding this comment

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

I have some infrastructure for compilation death tests, but pulled it out of mainline camp because checking the error messages proved rather brittle. If possible I'd say factor the test to use decltype on the binding to verify it's const-qualified as it should be, then we can keep the tests positive. If not I can dredge that stuff back up. It amounts to generating a non-auto cmake target that builds the test then registering cmake --build --target tgt as the test for ctest to run. Surprisingly robust, but also frustrating to make sure you're testing only what you want to test.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Well...maybe the static_assert( is_same<>) checks are sufficient. It is up to you.

Copy link
Member

Choose a reason for hiding this comment

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

I think the static_asserts are sufficient.

@rrsettgast
Copy link
Contributor Author

@trws I assume you squash merge, so this history doesn't need to be clean?

@trws
Copy link
Member

trws commented Oct 16, 2023 via email

@rrsettgast
Copy link
Contributor Author

@trws Is there something I need to do to pass the checks that are failing?

@trws
Copy link
Member

trws commented Oct 17, 2023

Nope, not this time. The sycl container broke a couple of days ago and I haven't had time to fix it yet. Thanks @rrsettgast!

@trws trws merged commit ce29d32 into LLNL:main Oct 17, 2023
12 of 14 checks passed
@rrsettgast rrsettgast deleted the bugfix/const_structured_bindings_tuple branch October 21, 2023 16: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.

implementation of tuple_element<i,camp::tuple<T...>> not allowing structured binding using const auto
2 participants