/usr/include/boost/accumulators/statistics
Edit: /usr/include/boost/accumulators/statistics/error_of.hpp (2588B)
///////////////////////////////////////////////////////////////////////////////
// error_of.hpp
//
// Copyright 2005 Eric Niebler. Distributed under the Boost
// Software License, Version 1.0. (See accompanying file
// LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
#ifndef BOOST_ACCUMULATORS_STATISTICS_ERROR_OF_HPP_EAN_29_11_2005
#define BOOST_ACCUMULATORS_STATISTICS_ERROR_OF_HPP_EAN_29_11_2005
#include
#include
#include
#include
#include
namespace boost { namespace accumulators
{
namespace impl
{
/// INTERNAL ONLY
///
template
struct this_feature_has_no_error_calculation
: mpl::false_
{
};
///////////////////////////////////////////////////////////////////////////////
// error_of_impl
/// INTERNAL ONLY
///
template
struct error_of_impl
: accumulator_base
{
// TODO: specialize this on the specific features that have errors we're
// interested in.
BOOST_MPL_ASSERT((this_feature_has_no_error_calculation));
// for boost::result_of
typedef int result_type;
error_of_impl(dont_care)
{
}
result_type result(dont_care) const
{
return 0;
}
};
} // namespace impl
///////////////////////////////////////////////////////////////////////////////
// tag::error_of
//
namespace tag
{
template
struct error_of
: depends_on
{
/// INTERNAL ONLY
///
typedef accumulators::impl::error_of_impl impl;
};
}
///////////////////////////////////////////////////////////////////////////////
// extract::error_of
//
namespace extract
{
BOOST_ACCUMULATORS_DEFINE_EXTRACTOR(tag, error_of, (typename))
}
using extract::error_of;
// make tag::error_of work
template
struct as_feature >
{
typedef tag::error_of::type> type;
};
// make error_of work with non-void weights (should become
// error_of
template
struct as_weighted_feature >
{
typedef tag::error_of::type> type;
};
}} // namespace boost::accumulators
#endif