Ok maybe this time I'll actually post to the right board.
Is there a STL method which will return a random element from a vector? Its easy enough to write such a method, but I was just wondering if one exists already. I've searched on google to no avail.
The whole point of a vector is to have sequential predictable access in O(1).
If you want random access to a member you can always do:
or similar depending how random you want it (rand is not new random as you know