| 6 | namespace bh = boost::histogram; |
| 7 | |
| 8 | int main() { |
| 9 | // create vector of axes, axis::any is a polymorphic axis type |
| 10 | auto v = std::vector<bh::axis::any_std>(); |
| 11 | v.push_back(bh::axis::regular<>(100, -1, 1)); |
| 12 | v.push_back(bh::axis::integer<>(1, 7)); |
| 13 | |
| 14 | // create dynamic histogram (make_static_histogram cannot be used with iterators) |
| 15 | auto h = bh::make_dynamic_histogram(v.begin(), v.end()); |
| 16 | |
| 17 | // do something with h |
| 18 | |
| 19 | |
| 20 | |
| 21 | // make_dynamic_histogram copies axis objects; to instead move the whole axis |
| 22 | // vector into the histogram, create a histogram instance directly |
| 23 | auto h2 = bh::histogram<decltype(v)>(std::move(v)); |
| 24 | |
| 25 | // do something with h2 |
| 26 | } |
| 27 | |
| 28 | //] |
nothing calls this directly
no test coverage detected