boostorg / boostorg/accumulators

[Regression] boost::accumulators::tag::rolling_mean requires comparison operators < and > as of boost 1.71.

Open
#36 0 comments 1 reaction 0 assignees View on GitHub
Dominant language
C++
Stars
26
Forks
61
PR merge metrics
No merged PRs in 30d

Description

Code that uses boost::accumulators::accumulator_set with where Stats contains boost::accumulators::tag::rolling_mean and X does not implement the operators < and > no longer compiles since [Fix #11437: correct immediate_rolling_mean](https://github.com/boostorg/accumulators/commit/5ff527ec3b30cba849f6f69067b8956b27ed73bd).

We were using this for coordinates in 3d, let's say `struct Vec3d { float x; float y; float z};` . This type doesn't have a natural order. (Note that lexicographic ordering does not respect rotation symmetries, etc.) So it doesn't make sense to define comparison operators for them.
Averaging, by contrast, is basically a linear combination, which is a perfectly valid operation for elements of vector spaces.

Code sample on [godbolt](https://godbolt.org/z/BYWpGg). This code breaks when upgrading from boost-1.70 to boost -1.71.

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.