mercredi 1 juillet 2015

Defining a Discrete Probability Distribution in C++

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://ift.tt/1R6pjgK.

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:

2 error C2661: 'std::discrete_distribution::discrete_distribution' : no overloaded function takes 2 arguments

3 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

Aucun commentaire:

Enregistrer un commentaire