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

Fix #2026 - Prevent logical<wide> to be constructed form non-bool single scalars #2052

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

jfalcou
Copy link
Owner

@jfalcou jfalcou commented Jan 17, 2025

No description provided.

@jfalcou jfalcou force-pushed the fix/issue-2026/logical-ctor branch from bcf275c to e96299e Compare January 17, 2025 20:25
@jfalcou jfalcou force-pushed the fix/issue-2026/logical-ctor branch from b2ffed7 to 2f54f64 Compare January 17, 2025 20:34
template<scalar_value S>
EVE_FORCEINLINE explicit logical(S v) noexcept
//! Construct from a scalar logical
template<typename U>
Copy link
Collaborator

Choose a reason for hiding this comment

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

Shouldn't this be scalar_value ?

Copy link
Owner Author

Choose a reason for hiding this comment

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

indeed

@jfalcou jfalcou added the release-candidate This issue is to be included in next milestone label Jan 22, 2025
@@ -255,7 +255,7 @@ named_shuffle1_test(eve::as<T>, NamedShuffle named_shuffle, auto... extra_args_g
named_shuffle1_test_one_input<supports_G_eq_T_Size>(x, named_shuffle, extra_args_gen...);

// false, true, false, false, true, true
eve::logical<T> mask {[](int i, int) { return std::countl_zero((unsigned)i) & 1; }};
eve::logical<T> mask {[](int i, int) { return (std::countl_zero((unsigned)i) & 1) != 0; }};
Copy link
Collaborator

Choose a reason for hiding this comment

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

Oh - but my lamda generation. Can I have my lambda generation maybe?

Copy link
Owner Author

Choose a reason for hiding this comment

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

The issue is that the lambda returns an int, not a bool. The lanbda ctor is fine

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
release-candidate This issue is to be included in next milestone
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants