histogram_fail1.cpp 578 B

123456789101112131415161718192021222324
  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_histogram.hpp>
  8. int main() {
  9. using namespace boost::histogram;
  10. struct accumulator {
  11. void operator()() {}
  12. };
  13. auto h = make_histogram_with(dense_storage<accumulator>(), axis::integer<>(0, 5));
  14. // invalid weight argument
  15. h(0, weight(1));
  16. auto values = {0, 1};
  17. h.fill(values, weight(1));
  18. }