如何使用这个template?# Programming - 葵花宝典
f*n
1 楼
boost里有这么一个生成正态分布随机数的template.
template
class normal_distribution
{
public:
typedef RealType input_type;
typedef RealType result_type;
explicit normal_distribution(const result_type& mean = 0,
const result_type& sigma = 1);
RealType mean() const;
RealType sigma() const;
void reset();
template
result_type operator()(UniformRandomNumberGenerator& urng);
};
如果想把UniformRandomNumberGenerator指定为lagged_fibon
template
class normal_distribution
{
public:
typedef RealType input_type;
typedef RealType result_type;
explicit normal_distribution(const result_type& mean = 0,
const result_type& sigma = 1);
RealType mean() const;
RealType sigma() const;
void reset();
template
result_type operator()(UniformRandomNumberGenerator& urng);
};
如果想把UniformRandomNumberGenerator指定为lagged_fibon