#ifndef ACCU_B_HPP_INCLUDED #define ACCU_B_HPP_INCLUDED #include #include #include #include #include #include #include #include #include #include namespace boost { namespace accumulators { namespace impl { //////////////////////////////////////////////////////////////////////////// // accu_b_impl template class accu_b_impl : public accumulator_base { typedef tag::accu_a a_type; public: typedef Sample result_type; template accu_b_impl(Args const &args) :x_( extract_result(args[accumulator]) //returns garbage ) { } accu_b_impl(const accu_b_impl& that) :x_(that.x_){} accu_b_impl& operator=(const accu_b_impl& that){ if(&that!=this){ x_ = that.x_; } return *this; } template void operator ()(Args const &args) { // overrides initialization x_ = extract_result(args[accumulator]); } result_type result(dont_care) const { return x_; } private: result_type x_; }; } // namespace impl /////////////////////////////////////////////////////////////////////////////// // tag::accu_b // namespace tag { template struct accu_b : depends_on > { /// INTERNAL ONLY typedef accumulators::impl::accu_b_impl impl; }; } }} // namespace boost::accumulators #endif