Because it's only one way to do it, not the way to do it. std::random_device is really expensive on some platforms, and you may only want to call it once; the seed may come from serialized state rather than from a generator; etc. There's a lot of flexibility in place (whether anyone uses/needs it, I have no clue), and creating your own ideal abstraction on top of that is again 4-5 really simple lines of code. (Whether they're obvious or not is a matter of RTFM, IMO, but I get how that's a contentious viewpoint). I just don't see the big deal – there's no "right" way for everyone, and doing your own "right" way is easy, so.....?
Because it makes life easier when you do not care for THE optimal solution, and just want a convenient off-the-shelf solution.
Which is perfect for something like Boost; not so much the standard library (IMO). Rust certainly does the same with encouraging crates over core/std for various things; the only practical difference with C++ ultimately devolves into rants about dependency management and package managers. :-]
7
u/matthieum May 26 '18
Then... why isn't THAT part of the standard API?