#include <random>
int main()
{
using namespace std;
mt19937_64 gen1(random_device()());//fail?
mt19937_64 gen2((random_device()()));//success
mt19937_64 gen3{ random_device()() };//success
mt19937_64 gen4(random_device{}());//success
return 0;
}
The complier gives me these infomation below ,but I still don't understand why my code is illegal :
prog.cpp: In function 'int main()':
prog.cpp:6:33: error: 'parameter' declared as function returning a function
mt19937_64 gen(random_device()());