Skip to content

Fix warnings from use of std::accumulate in xbuilder#2926

Merged
JohanMabille merged 2 commits into
xtensor-stack:masterfrom
bredej:master
Jun 19, 2026
Merged

Fix warnings from use of std::accumulate in xbuilder#2926
JohanMabille merged 2 commits into
xtensor-stack:masterfrom
bredej:master

Conversation

@bredej

@bredej bredej commented Jun 19, 2026

Copy link
Copy Markdown
Contributor

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

The internal type of std::accumulate is determined by the init parameter.
Initializing with 0 (int) results in a "conversion from 'size_t' to 'type', possible loss of data" warning in MSVC.
Related #2732

The second commit replacing size_t with std::size_t is just for consistency.

@codspeed-hq

codspeed-hq Bot commented Jun 19, 2026

Copy link
Copy Markdown
Contributor

Merging this PR will not alter performance

✅ 255 untouched benchmarks


Comparing bredej:master (bfbf021) with master (dd857e5)

Open in CodSpeed

@JohanMabille JohanMabille left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Thanks!

@JohanMabille JohanMabille merged commit aa2b3ef into xtensor-stack:master Jun 19, 2026
38 checks passed
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.

2 participants