What I have
Header file:
int randomInt(int start, int end);
Implementation file:
int randomInt(int start, int end) {
static std::random_device rd; // Obtain a random number from hardware
static std::mt19937 eng(rd());// Seed the generator
std::uniform_int_distribution<> dist(start, end);
return dist(eng);
}
What I want to do
Would it be optimal to make this function inline or anything else? If so, how would I deal with the static variables?