#include <algorithm>
#include <iostream>
#include <functional>
#include <random>
#include <time.h>

int main() {
	std::mt19937 mersenne_engine(time(NULL));
	std::uniform_int_distribution<unsigned int> distribution(1, 10);
	auto generator = std::bind(distribution, mersenne_engine);
	
	for(unsigned int i=0; i<10; ++i) {
		std::vector<unsigned int> weights(10);
		
		// This line always generates the same vector content.
		std::generate(weights.begin(), weights.end(), generator);
		// This line properly randomizes the content each iteration.
		//for(auto &weight : weights) weight = generator();
		
		for(auto &weight : weights) {
			std::cout << weight << " ";
		}
		std::cout << std::endl;
	}
}
