Visual Studio 2019 c++latest random_device uniform_int_distribution throws unhandled exception

134 Views Asked by At
    random_device device;
    uniform_int_distribution<long> dist(-5, 5);
    vector<long> v;
    v.resize(20);
    generate(v.begin(), v.end(), [&] { return dist(device); }); // <- Unhandled exception.

Exception details:

Unhandled exception at 0x00AB3FDF in test.exe: 0xC000001D: Illegal Instruction.

It used to work but now fails after installing the latest Visual Studio 2019 update. Any advice and insight is appreciated.

1

There are 1 best solutions below

0
On

I cannot reproduce the error on VS2019 under win10.

Normally this kind of issue comes due corrupt temporary files within .vs folder or corrupt project settings, in this case after the VS update.

What you can do is to create a fresh new project and compare/copy the setting files to the existing project (with eventually update the filepaths). Also removing .vs folder at the existing project could help.