【发布时间】:2014-10-27 16:42:48
【问题描述】:
我想使用 boost::accumulator 来定义我的自定义类的移动平均值:
boost::accumulators::accumulator_set<MySample, boost::accumulators::stats<boost::accumulators::tag::rolling_mean> >
我的问题是我的示例是用户定义的类(另一个库的向量实现)。
我看到in this post 可以为std::vectors 定义累加器,但它没有指定必须重载哪个运算符,因为它使用boost/accumulators/numeric/functional/vector.hpp 重载它们。
如果我想将累加器与用户定义的示例类一起使用,我必须重载哪个运算符以及如何重载?
【问题讨论】:
-
你弄明白了吗?
标签: c++ boost vector operator-overloading boost-accumulators