
Boost Histogram: Fast multidimensional histogram, convenient interface for C++14 - ingve
https://github.com/boostorg/histogram
======
stabbles
How many people would immediately understand the code sample:

    
    
        auto h = make_histogram(
          axis::regular<>(6, -1.0, 2.0, "x")
        );
    
        // fill histogram
        auto data = { -10, -0.4, 1.1, 0.3, 1.3 };
        std::for_each(data.begin(), data.end(), std::ref(h));
    

I would have to Google what std::ref does again, and then I have to understand
why it is used, etc. The code is short and readable, but understanding it
still takes time.

~~~
jzwinck

        for (double x : { -10, -0.4, 1.1, 0.3, 1.3 })
          h(x);
    

Shorter, better.

~~~
wnissen
Yeah, for_each is a great idea and if you don't have C++'s complicated
reference / copy object model it works very well. But it's not as nice as an
actual for loop.

------
therobot24
love this lib, been using it for awhile, but when i was trying to get it
running with ROS Indigo i had to backport Boost Variant ...never want to do
that again

~~~
petschge
And that is the main problem with boost. If you want any of it, you have to
live with all of it.

~~~
olq_plo
Some Boost libraries have little or no dependency on other libraries, e.g.
boost::mp11. In the past, our libraries used to be very interdependent, but we
recognize that this is an issue and nowadays try to decouple the libraries so
that you can install only the parts you need.

We even provide a tool to help with that:
[https://www.boost.org/doc/libs/1_70_0/tools/bcp/doc/html/ind...](https://www.boost.org/doc/libs/1_70_0/tools/bcp/doc/html/index.html)

boost::histogram currently depends directly on 8 other boost libraries, but
some of those (e.g. boost::variant) pull in a huge number of other libraries,
so in total it is 29. I am working on reducing the dependencies in the
upcoming versions.

~~~
petschge
Pretty cool to see that boost admits that this is an issue and works on
decoupling things. I look forward to see improvements here.

