How to get 2 random (different) elements from a c++ vector
- by Peter Smit
I would like to get 2 random different elements from an std::vector. How can I do this so that:
It is fast (it is done thousands of times in my algorithm)
It is elegant
The elements selection is really uniformly distributed