Skip to content

Conversation

@timo-eichhorn
Copy link

Unless I'm somehow misunderstanding how pcg_extras::seed_seq_from is supposed to be used, I believe the result_type typedef in pcg_extras::seed_seq_from should be public instead of private. Otherwise, when trying to use pcg_extras::seed_seq_from with standard library PRNGs (say std::mt19937), compilation fails (for both gcc 12.1.0 and clang 14.0.0) due to the aforementioned typedef being private.

A simple example demonstrating the problem:

#include <random>
#include "PCG/pcg_random.hpp"
#include "PCG/pcg_extras.hpp"

int main()
{
    pcg_extras::seed_seq_from<std::random_device> seed_source;

    pcg64        pcg_generator(seed_source); // This works
    std::mt19937 mt_generator(seed_source);  // This does not
    return 0;
}

After the change, the program compiles without problems.

timo-eichhorn and others added 3 commits June 11, 2023 23:08
Changed result_type typedef in pcg_extras::seed_seq_from to be public in order to be compatible with standard library PRNGs
@JkarVN
Copy link

JkarVN commented Dec 24, 2025

Merged into Total-Random/pcg-cpp

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants