Skip to content

Fix xt::drop with variables#2912

Open
Alex-PLACET wants to merge 5 commits intoxtensor-stack:masterfrom
Alex-PLACET:fix_drop_with_variables
Open

Fix xt::drop with variables#2912
Alex-PLACET wants to merge 5 commits intoxtensor-stack:masterfrom
Alex-PLACET:fix_drop_with_variables

Conversation

@Alex-PLACET
Copy link
Copy Markdown
Contributor

@Alex-PLACET Alex-PLACET commented May 6, 2026

Checklist

  • The title and commit message(s) are descriptive.
  • Small commits made to fix your PR have been squashed to avoid history pollution.
  • Tests have been added for new features or bug fixes.
  • API of new functions and classes are documented.

Description

Address #2867

Changed xtl::is_integral<T>::value to xtl::is_integral<std::decay_t<T>>::value in the drop() function template. When passing a variable like size_t index = 1, T deduces to unsigned long&, a reference type, which is_integral rejects. Decaying strips the reference so the integral branch is correctly taken.

@Alex-PLACET Alex-PLACET linked an issue May 6, 2026 that may be closed by this pull request
@Alex-PLACET Alex-PLACET marked this pull request as ready for review May 6, 2026 13:41
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.

Potential Regression in xt::drop

1 participant