I have a boring function to run, I want to loop through it to save this time (I have all the data to), but it requires types. Is there a way to make an array of types, or have some comple-time thing to do this? (If it helps, I have 3 types and want to run the method with all types against all types).
fprintf(stdout, "Testing UTF-32...\n");
testUTF<uint32_t, uint32_t>(&testEncs[0], &testEncs[0]);
testUTF<uint32_t, uint16_t>(&testEncs[0], &testEncs[1]);
testUTF<uint32_t, uint8_t> (&testEncs[0], &testEncs[2]);
fprintf(stdout, "Testing UTF-16...\n");
testUTF<uint16_t, uint32_t>(&testEncs[1], &testEncs[0]);
testUTF<uint16_t, uint16_t>(&testEncs[1], &testEncs[1]);
testUTF<uint16_t, uint8_t> (&testEncs[1], &testEncs[2]);
fprintf(stdout, "Testing UTF-8...\n");
testUTF<uint8_t, uint32_t>(&testEncs[2], &testEncs[0]);
testUTF<uint8_t, uint16_t>(&testEncs[2], &testEncs[1]);
testUTF<uint8_t, uint8_t> (&testEncs[2], &testEncs[2]);
1 Answer