The sigma is passed in the constructor, so do it like this:
const double sigma = 5.;
boost::math::rayleigh_distribution<> rayleigh(sigma);
The method sigma() merely returns a copy of the set sigma, so you cannot use that.
What Scheff was referring to is that it would also work (given you want sigma to be 1.) if you do that
boost::math::rayleigh_distribution<> rayleigh{};
as this has no ambiguity with a function declaration, but is setting sigma to 1.
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…