Simulates an election using random functions and class templates in C++