Hi, i guess you need to initialize your static variables outside that class because they will be created before any class instance is constructed, you might do this
No, you cannot do this in main, or in any function for that matter. It mus be done in the same (global) scope as the class.
Generally, this is a bad idea - I would recommend that the random number generator be passed to the instance by reference so that the calling code can do as it wishes with regards to the RNG.
@LB Not sure why andy was suggesting using a shared_ptr I wasn't suggesting that the Op use shared_ptr , i just couldn't figure out why in the first place he used them in an rng given the short snippet, so i just decided to correct his error n that's all.