有人可以告诉我使用 boost 的正态分布的这段代码发生了什么吗?
boost::mt19937 rng; // A random number generator
boost::normal_distribution<> nd(3.0, 1.0); // mean 3, sigma 1
// Attach the distribution to the random number generator to get a function
// that returns normally distributed variables.
boost::variate_generator<boost::mt19937&,boost::normal_distribution<> > var_nor(rng, nd);
// Use it. But why is function signature different?
double x = var_nor();
我对 var_nor 及其两个函数签名发生的事情感到困惑。谢谢皮特