I am looking for an opportunity to use a function where I pass a pointer to the values of uint16_t or uint32_t.
I am currently using two overloaded functions
std::vector<float> calcMap(uint16_t* map)
std::vector<float> calcMap(uint32_t* map)
Since they return floating point values, the calculation is the same for 16 and 32 bit values. The only difference is the data type that is required to traverse the specified array. I do not want all the content of the function twice, is there any way to make it independent of type?
source
share