123456789101112131415161718192021222324252627282930313233343536 |
- #ifndef BOOST_HISTOGRAM_ALGORITHM_EMPTY_HPP
- #define BOOST_HISTOGRAM_ALGORITHM_EMPTY_HPP
- #include <boost/histogram/fwd.hpp>
- #include <boost/histogram/indexed.hpp>
- namespace boost {
- namespace histogram {
- namespace algorithm {
- template <class A, class S>
- auto empty(const histogram<A, S>& h, coverage cov) {
- using value_type = typename histogram<A, S>::value_type;
- const value_type default_value = value_type();
- for (auto&& ind : indexed(h, cov)) {
- if (*ind != default_value) { return false; }
- }
- return true;
- }
- }
- }
- }
- #endif
|