Почему нельзя вызвать оператор()() для объекта mt19937?C++

Программы на C++. Форум разработчиков
Anonymous
Почему нельзя вызвать оператор()() для объекта mt19937?

Сообщение Anonymous »

Код: Выделить всё

#include 
#include 

using std::random_device;
using std::mt19937;
using std::uniform_int_distribution;
using std::cout;
using std::endl;

int genRndInRng(int min=0, int max=9)
{
random_device rd;
mt19937 rng(rd());
uniform_int_distribution uni(min,max);
//return uni(rng());
return uni(rng);
}
int func()
{
cout 

Подробнее здесь: [url]https://stackoverflow.com/questions/79846378/why-cant-the-operator-be-invoked-on-the-mt19937-object[/url]

Вернуться в «C++»