histogram_fail3.cpp 608 B

1234567891011121314151617181920212223
  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. struct accumulator {
  10. void operator()(double) {}
  11. };
  12. using namespace boost::histogram;
  13. auto h = make_histogram_with(dense_storage<accumulator>(), axis::integer<>(0, 5));
  14. // wrong number of sample arguments
  15. h(0, sample(1, 2));
  16. auto values = {0, 1};
  17. h.fill(values, sample(values, values));
  18. }