I have a C++ function that takes in an array of uint8_t performs various functions on it that require a uint16_t and emits a smaller uint8_t array.
For a uint16_t input I might need a uint32_t array, etc.
Is there a way to establish this relationship using templates? Something like (in pseudocode):
template <typename T, typename U = sizeof(T) * 2>
Unfortunately, I am actually working in a mix of cython and c++ so there's no avoiding a lot of copy-pasting, but I was wondering if this was an option in some cases.