Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- struct RandomGenerator {
- int maxValue;
- RandomGenerator(int max) :
- maxValue(max) {
- }
- int operator()() {
- return rand() % maxValue;
- }
- };
- std::generate(vec.begin(), vec.end(), RandomGenerator(499));
Advertisement
Add Comment
Please, Sign In to add comment