histogram_fail2.cpp 638 B

12345678910111213141516171819202122232425
  1. // Copyright 2019 Hans Dembinski
  2. //
  3. // Distributed under the Boost Software License, Version 1.0.
  4. // (See accompanying file LICENSE_1_0.txt
  5. // or copy at http://www.boost.org/LICENSE_1_0.txt)
  6. #include <boost/histogram/axis/integer.hpp>
  7. #include <boost/histogram/make_profile.hpp>
  8. int main() {
  9. using namespace boost::histogram;
  10. struct accumulator {
  11. void operator()(double) {}
  12. void operator()(weight_type<double>, double) {}
  13. };
  14. auto h = make_histogram_with(dense_storage<accumulator>(), axis::integer<>(0, 5));
  15. // accumulator requires sample
  16. h(0, weight(1));
  17. auto values = {1, 2};
  18. h.fill(values, weight(1));
  19. }