Do all C++ STLs pr开发者_如何学编程oduce the same random numbers (for the same seed)? Does this hold for all platforms? Is this specified somewhere?
No, the standard does not require a specific implementation. Also, the only standard way to get random numbers are rand
and srand
, and they are not part of what originally was the STL, but rather functions taken over from C.
精彩评论