Pet*_*217 1 c++ boost function signature
有人可以使用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();
Run Code Online (Sandbox Code Playgroud)
我对var_nor及其两个函数签名发生了什么感到困惑.谢谢皮特