File indexing completed on 2025-01-18 09:28:19
0001
0002
0003
0004
0005
0006
0007
0008 #ifndef BOOST_ACCUMULATORS_STATISTICS_ERROR_OF_HPP_EAN_29_11_2005
0009 #define BOOST_ACCUMULATORS_STATISTICS_ERROR_OF_HPP_EAN_29_11_2005
0010
0011 #include <boost/mpl/placeholders.hpp>
0012 #include <boost/accumulators/framework/accumulator_base.hpp>
0013 #include <boost/accumulators/framework/extractor.hpp>
0014 #include <boost/accumulators/framework/depends_on.hpp>
0015 #include <boost/accumulators/statistics_fwd.hpp>
0016
0017 namespace boost { namespace accumulators
0018 {
0019
0020 namespace impl
0021 {
0022
0023
0024 template<typename Feature>
0025 struct this_feature_has_no_error_calculation
0026 : mpl::false_
0027 {
0028 };
0029
0030
0031
0032
0033
0034 template<typename Sample, typename Feature>
0035 struct error_of_impl
0036 : accumulator_base
0037 {
0038
0039
0040 BOOST_MPL_ASSERT((this_feature_has_no_error_calculation<Feature>));
0041
0042
0043 typedef int result_type;
0044
0045 error_of_impl(dont_care)
0046 {
0047 }
0048
0049 result_type result(dont_care) const
0050 {
0051 return 0;
0052 }
0053 };
0054
0055 }
0056
0057
0058
0059
0060 namespace tag
0061 {
0062 template<typename Feature>
0063 struct error_of
0064 : depends_on<Feature>
0065 {
0066
0067
0068 typedef accumulators::impl::error_of_impl<mpl::_1, Feature> impl;
0069 };
0070 }
0071
0072
0073
0074
0075 namespace extract
0076 {
0077 BOOST_ACCUMULATORS_DEFINE_EXTRACTOR(tag, error_of, (typename))
0078 }
0079
0080 using extract::error_of;
0081
0082
0083 template<typename Feature>
0084 struct as_feature<tag::error_of<Feature> >
0085 {
0086 typedef tag::error_of<typename as_feature<Feature>::type> type;
0087 };
0088
0089
0090
0091 template<typename Feature>
0092 struct as_weighted_feature<tag::error_of<Feature> >
0093 {
0094 typedef tag::error_of<typename as_weighted_feature<Feature>::type> type;
0095 };
0096
0097 }}
0098
0099 #endif