Common snippets of code that I should remember and do them exactly this way each time to build memory.

Random number generation

#include<random>
 
int random_int(int low, int high) {
    thread_local std::mt19937 gen(std::random_device{}());
    std::uniform_int_distribution<> dist(low, high);
    return dist(gen);
}