-
Notifications
You must be signed in to change notification settings - Fork 547
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
Random generator #218
Comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Right now the random generator is
static
, but this adds one generator to each cpp file that calls fornc::random
. Should it beinline
instead?I have a file
mylib.cpp
that usesnc::random::rand<float>({5, 10})
and I compile it as a library. and I have another filemain.cpp
that calls fornc::random::seed((int)time(nullptr))
and uses the library, but I was getting the same random values all the time.I tested
inline std::mt19937_64 generator_;
and now my library does generates different values.I am not entirely sure if this is a fix, otherwise I would make a PR, but my library only works with
inline
.The text was updated successfully, but these errors were encountered: