Cemu icon indicating copy to clipboard operation
Cemu copied to clipboard

[Bug] Random number generator causing static assert

Open ArtemisX64 opened this issue 2 years ago • 1 comments

Cemu Version 2.0(Latest Upstream) Test Platform: Linux

Issue

Discover why random number generator is causing static assert particularly in cemu

Other Notes

It works outside of cemu repository using clang14 and libstdc++

Example of function having issue

std::string GenerateRandomString(size_t length, std::string_view characters)
{
    assert(!characters.empty());
    std::stringstream result;

    std::random_device rd;
    std::mt19937 gen(rd());
    std::uniform_int_distribution<decltype(characters.size())> index_dist(0, characters.size() - 1);
    for (uint32_t i = 0; i < length; ++i)
    {
        result << characters[index_dist(gen)]; //Issue occurs with this function[index_dist(gen)] during compilation
    }

    return result.str();
}

ArtemisX64 avatar Aug 25 '22 15:08 ArtemisX64

Reopening this because the actual cause has yet to be found

Exzap avatar Aug 26 '22 12:08 Exzap