Mercurial > hg > vamp-build-and-test
annotate DEPENDENCIES/generic/include/boost/accumulators/statistics/count.hpp @ 133:4acb5d8d80b6 tip
Don't fail environmental check if README.md exists (but .txt and no-suffix don't)
author | Chris Cannam |
---|---|
date | Tue, 30 Jul 2019 12:25:44 +0100 |
parents | 2665513ce2d3 |
children |
rev | line source |
---|---|
Chris@16 | 1 /////////////////////////////////////////////////////////////////////////////// |
Chris@16 | 2 // count.hpp |
Chris@16 | 3 // |
Chris@16 | 4 // Copyright 2005 Eric Niebler. Distributed under the Boost |
Chris@16 | 5 // Software License, Version 1.0. (See accompanying file |
Chris@16 | 6 // LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) |
Chris@16 | 7 |
Chris@16 | 8 #ifndef BOOST_ACCUMULATORS_STATISTICS_COUNT_HPP_EAN_28_10_2005 |
Chris@16 | 9 #define BOOST_ACCUMULATORS_STATISTICS_COUNT_HPP_EAN_28_10_2005 |
Chris@16 | 10 |
Chris@16 | 11 #include <boost/mpl/always.hpp> |
Chris@16 | 12 #include <boost/accumulators/framework/accumulator_base.hpp> |
Chris@16 | 13 #include <boost/accumulators/framework/extractor.hpp> |
Chris@16 | 14 #include <boost/accumulators/framework/depends_on.hpp> |
Chris@16 | 15 #include <boost/accumulators/statistics_fwd.hpp> |
Chris@16 | 16 |
Chris@16 | 17 namespace boost { namespace accumulators |
Chris@16 | 18 { |
Chris@16 | 19 |
Chris@16 | 20 namespace impl |
Chris@16 | 21 { |
Chris@16 | 22 |
Chris@16 | 23 /////////////////////////////////////////////////////////////////////////////// |
Chris@16 | 24 // count_impl |
Chris@16 | 25 struct count_impl |
Chris@16 | 26 : accumulator_base |
Chris@16 | 27 { |
Chris@16 | 28 // for boost::result_of |
Chris@16 | 29 typedef std::size_t result_type; |
Chris@16 | 30 |
Chris@16 | 31 count_impl(dont_care) |
Chris@16 | 32 : cnt(0) |
Chris@16 | 33 { |
Chris@16 | 34 } |
Chris@16 | 35 |
Chris@16 | 36 void operator ()(dont_care) |
Chris@16 | 37 { |
Chris@16 | 38 ++this->cnt; |
Chris@16 | 39 } |
Chris@16 | 40 |
Chris@16 | 41 result_type result(dont_care) const |
Chris@16 | 42 { |
Chris@16 | 43 return this->cnt; |
Chris@16 | 44 } |
Chris@16 | 45 |
Chris@16 | 46 private: |
Chris@16 | 47 std::size_t cnt; |
Chris@16 | 48 }; |
Chris@16 | 49 |
Chris@16 | 50 } // namespace impl |
Chris@16 | 51 |
Chris@16 | 52 /////////////////////////////////////////////////////////////////////////////// |
Chris@16 | 53 // tag::count |
Chris@16 | 54 // |
Chris@16 | 55 namespace tag |
Chris@16 | 56 { |
Chris@16 | 57 struct count |
Chris@16 | 58 : depends_on<> |
Chris@16 | 59 { |
Chris@16 | 60 /// INTERNAL ONLY |
Chris@16 | 61 /// |
Chris@16 | 62 typedef mpl::always<accumulators::impl::count_impl> impl; |
Chris@16 | 63 }; |
Chris@16 | 64 } |
Chris@16 | 65 |
Chris@16 | 66 /////////////////////////////////////////////////////////////////////////////// |
Chris@16 | 67 // extract::count |
Chris@16 | 68 // |
Chris@16 | 69 namespace extract |
Chris@16 | 70 { |
Chris@16 | 71 extractor<tag::count> const count = {}; |
Chris@16 | 72 |
Chris@16 | 73 BOOST_ACCUMULATORS_IGNORE_GLOBAL(count) |
Chris@16 | 74 } |
Chris@16 | 75 |
Chris@16 | 76 using extract::count; |
Chris@16 | 77 |
Chris@16 | 78 }} // namespace boost::accumulators |
Chris@16 | 79 |
Chris@16 | 80 #endif |