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_MIN_HPP_EAN_28_10_2005
9 #define BOOST_ACCUMULATORS_STATISTICS_MIN_HPP_EAN_28_10_2005
12 #include <boost/mpl/placeholders.hpp>
13 #include <boost/accumulators/framework/accumulator_base.hpp>
14 #include <boost/accumulators/framework/extractor.hpp>
15 #include <boost/accumulators/framework/parameters/sample.hpp>
16 #include <boost/accumulators/numeric/functional.hpp>
17 #include <boost/accumulators/framework/depends_on.hpp>
18 #include <boost/accumulators/statistics_fwd.hpp>
20 namespace boost
{ namespace accumulators
25 ///////////////////////////////////////////////////////////////////////////////
27 template<typename Sample
>
31 // for boost::result_of
32 typedef Sample result_type
;
34 template<typename Args
>
35 min_impl(Args
const &args
)
36 : min_(numeric::as_max(args
[sample
| Sample()]))
40 template<typename Args
>
41 void operator ()(Args
const &args
)
43 numeric::min_assign(this->min_
, args
[sample
]);
46 result_type
result(dont_care
) const
57 ///////////////////////////////////////////////////////////////////////////////
67 typedef accumulators::impl::min_impl
<mpl::_1
> impl
;
71 ///////////////////////////////////////////////////////////////////////////////
76 extractor
<tag::min
> const min
= {};
81 }} // namespace boost::accumulators