从'std :: exponential_distribution <double>(*)(double)'到'std :: exponential_distribution <double> *'的参数没有已知的转换

时间:2015-10-26 16:27:14

标签: c++ c++11 random standard-library c++-standard-library

我不太明白这个错误repmat正在向我投掷。

g++std::exponential_distribution<double> (*)(double)之间的区别是什么?

第二个显然是指向带有模板参数std::exponential_distribution<double>*的{​​{1}}的指针,但第一个是什么?

以下是导致问题的代码:

首先是函数原型

std::exponential_distribution

调用此函数的代码:

<double>

这是一个奇怪的错误 - 如果我完全理解它的意思,我相信我能解决它。对我来说,统一分布是否有效并且指数不是这样,这似乎很奇怪?

1 个答案:

答案 0 :(得分:1)

你已经从评论中得到了答案,但只是为了记录,std::exponential_distribution<double> (*)(double)是一个函数指针类型:一个函数占用一个double并返回std::exponential_distribution<double>

相关问题