Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Make result_type typedef in pcg_extras::seed_seq_from public #83

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

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.

Changed result_type typedef in pcg_extras::seed_seq_from to be public in order to be compatible with standard library PRNGs
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.

1 participant