It's something id like to try (however in c++) but I'm not sure how to do it in a smart/not-too-ugly way