I would go so far as to say never use rand()
Unless you wrote it, of course. ;) I'm at the point with my C standard library that I use it instead of the built-in standard library for most personal work. rand
is implemented as the Mersenne Twister, so I know it's solid at least in terms of the underlying algorithm.
In C++, I agree that there's really no excuse to ignore the <random>
library if your compiler conforms sufficiently to C++11.