我目前正在嘗試使用Boost :: accumulators,但在構造函數中初始化時出現編譯錯誤。請查看下面的課程詳情。Boost :: accumulators在Mac OSX上初始化失敗Yosemite
Environment:
Mac OSX Yosemite
G++ version:
4.2.1
Boot Version: 1.55
代碼:
class test
{
public:
test();
test(unsigned char windowSize=5): acc(tag::rolling_window::window_size=windowSize){}
protected:
accumulator_set<unsigned short, stats<tag::rolling_mean > > acc;
private:
};
錯誤:
/usr/local/boost/include/boost/accumulators/statistics/rolling_window.hpp|49|error: no viable overloaded operator[] for type 'const boost::parameter::aux::arg_list<boost::parameter::aux::tagged_argument<boost::accumulators::tag::accumulator, boost::accumulators::accumulator_set<unsigned short, boost::accumulators::stats<boost::accumulators::tag::rolling_mean, mpl_::na, mpl_::na, mpl_::na, mpl_::na, mpl_::na, mpl_::na, mpl_::na, mpl_::na, mpl_::na, mpl_::na, mpl_::na, mpl_::na, mpl_::na, mpl_::na, mpl_::na, mpl_::na, mpl_::na, mpl_::na, mpl_::na, mpl_::na, mpl_::na, mpl_::na, mpl_::na, mpl_::na, mpl_::na, mpl_::na, mpl_::na, mpl_::na, mpl_::na, mpl_::na, mpl_::na, mpl_::na, mpl_::na, mpl_::na, mpl_::na, mpl_::na, mpl_::na, mpl_::na, mpl_::na, mpl_::na, mpl_::na, mpl_::na, mpl_::na, mpl_::na, mpl_::na, mpl_::na, mpl_::na, mpl_::na, mpl_::na, mpl_::na, mpl_::na, mpl_::na, mpl_::na, mpl_::na, mpl_::na, mpl_::na, mpl_::na, mpl_::na, mpl_::na, mpl_::na, mpl_::na, mpl_::na, mpl_::na, mpl_::na, mpl_::na, mpl_::na, mpl_::na, mpl_::na, mpl_::na>, void> >, boost::parameter::aux::empty_arg_list>'|
-----------
/usr/local/boost/include/boost/parameter/aux_/arg_list.hpp|346|note: candidate function not viable: no known conversion from 'keyword<tag::rolling_window_size>' to 'const keyword<key_type>' for 1st argument|
-------------------