1
我有這樣的示例代碼和它拋出一個錯誤:是<random>完全在Visual Studio支持2012
std::random_device rd; // only used once to initialise engine
std::mt19937 rng(rd); // random-number engine used
std::uniform_int_distribution<int> uni(0, 7); // guaranteed unbiased
int random_integer = uni(rng);
的錯誤是:
Error 1 error C2039: 'generate' : is not a member of 'std::random_device' c:\program files (x86)\microsoft visual studio 12.0\vc\include\random 1618 1 Life
可以somone解釋我請,爲什麼會這樣?它似乎是在頭文件中的錯誤,而不是在我的代碼中。
我該如何解決?
謝謝。