Skip to content

[Bug] Random number generator causing static assert #48

Closed as not planned
@ArtemisX64

Description

@ArtemisX64

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();
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions