I have been trying to create my own discrete distribution in Visual Studio (C++). I kept getting the same error. I then tried the example code from: http://www.cplusplus.com/reference/random/discrete_distribution/discrete_distribution/.
Again, the same error appeared with this example code.
The line of code (from the link) that is giving me an error is:
std::discrete_distribution second(init.begin(), init.end());
Particularly, init.begin()
is underlined in red.
The 2 errors are as follows:
error C2661: 'std::discrete_distribution::discrete_distribution' : no overloaded function takes 2 arguments
IntelliSense: no instance of constructor "std::discrete_distribution<_Ty>::discrete_distribution [with _Ty=int]" matches the argument list argument types are: (std::_Array_iterator, std::_Array_iterator)
Why would my compiler not work? I am wondering if other people are getting the same errors? I also just updated my version of Visual Studio to make sure it wasn't an old bug
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…