Boost logo

Boost Users :

From: Warren Weckesser (warren.weckesser_at_[hidden])
Date: 2022-05-02 01:28:07


This is probably more of a C++ question than a Boost/Math question. I
think the answer comes down to a (surprising?) Boost namespace
convention.

In a program like this:

```
#include <boost/math/distributions/beta.hpp>

using boost::math::beta_distribution;

int main()
{
    float a = 1.5f;
    float b = 3.0f;
    beta_distribution<float> dist(a, b);

    auto m = mean(dist);
}
```

how does the name 'mean' end up in scope in 'main()'? I would have
expected (and preferred!) something like 'using boost::math::mean;' to
be required.

Warren


Boost-users list run by williamkempf at hotmail.com, kalb at libertysoft.com, bjorn.karlsson at readsoft.com, gregod at cs.rpi.edu, wekempf at cox.net