1 ///////////////////////////////////////////////////////////////////////////////
4 // Copyright 2005 Eric Niebler. Distributed under the Boost
5 // Software License, Version 1.0. (See accompanying file
6 // LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
8 #ifndef BOOST_ACCUMULATORS_STATISTICS_ERROR_OF_HPP_EAN_29_11_2005
9 #define BOOST_ACCUMULATORS_STATISTICS_ERROR_OF_HPP_EAN_29_11_2005
11 #include <boost/mpl/placeholders.hpp>
12 #include <boost/accumulators/framework/accumulator_base.hpp>
13 #include <boost/accumulators/framework/extractor.hpp>
14 #include <boost/accumulators/framework/depends_on.hpp>
15 #include <boost/accumulators/statistics_fwd.hpp>
17 namespace boost { namespace accumulators
24 template<typename Feature>
25 struct this_feature_has_no_error_calculation
30 ///////////////////////////////////////////////////////////////////////////////
34 template<typename Sample, typename Feature>
38 // TODO: specialize this on the specific features that have errors we're
40 BOOST_MPL_ASSERT((this_feature_has_no_error_calculation<Feature>));
42 // for boost::result_of
43 typedef int result_type;
45 error_of_impl(dont_care)
49 result_type result(dont_care) const
57 ///////////////////////////////////////////////////////////////////////////////
62 template<typename Feature>
68 typedef accumulators::impl::error_of_impl<mpl::_1, Feature> impl;
72 ///////////////////////////////////////////////////////////////////////////////
77 BOOST_ACCUMULATORS_DEFINE_EXTRACTOR(tag, error_of, (typename))
80 using extract::error_of;
82 // make tag::error_of<tag::feature(modifier)> work
83 template<typename Feature>
84 struct as_feature<tag::error_of<Feature> >
86 typedef tag::error_of<typename as_feature<Feature>::type> type;
89 // make error_of<tag::mean> work with non-void weights (should become
90 // error_of<tag::weighted_mean>
91 template<typename Feature>
92 struct as_weighted_feature<tag::error_of<Feature> >
94 typedef tag::error_of<typename as_weighted_feature<Feature>::type> type;
97 }} // namespace boost::accumulators