我想使用 boost::accumulator 来定义我的自定义类的移动平均值:
boost::accumulators::accumulator_set<MySample, boost::accumulators::stats<boost::accumulators::tag::rolling_mean> >
我的问题是我的示例是用户定义的类(另一个库的向量实现)。
我在这篇文章中看到可以为 std::vectors 定义累加器,但它没有指定必须重载哪个运算符,因为它用boost/accumulators/numeric/functional/vector.hpp
.
如果我想将累加器与用户定义的示例类一起使用,我必须重载哪个运算符以及如何重载?