[Math / Distributions] How do mean, variance, etc end up in scope?

Warren Weckesser via Boost-users <[email protected]>
Newsgroups gmane.comp.lib.boost.user
Message-ID <CAGzF1ufLCEPDCtit8HMEQoC5Njcq74qXzT3-5Juf93vbwzgdjw@mail.gmail.com>
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
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.