Guest User

Untitled

a guest
Feb 6th, 2019
152
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.21 KB | None | 0 0
  1. struct RandomGenerator {
  2. int maxValue;
  3. RandomGenerator(int max) :
  4. maxValue(max) {
  5. }
  6. int operator()() {
  7. return rand() % maxValue;
  8. }
  9. };
  10.  
  11. std::generate(vec.begin(), vec.end(), RandomGenerator(499));
Advertisement
Add Comment
Please, Sign In to add comment