Q:

C++ Best Practice: function to accept uint8_t, uint16_t, uint32_t, float

i've got a set of (potential overloading) functions:
write(uint16_t index, uint16_t subindex, uint8_t  data)
write(uint16_t index, uint16_t subindex, uint16_t data)
write(uint16_t index, uint16_t subindex, uint32_t data)
write(uint16_t index, uint16_t subindex, float    data)

Despite eclipse showing me for example typedef unsigned short int  uint16_t; when I hover over the uint16_t, I've got the error:
call of overloaded ‘`write(int, int, int)`’ is ambiguous

Inside the function I must know, if data was a uint8_t, uint16_t, etc.
What can i do?
Is there another way, e.g. 
    write(uint16_t index, uint16_t subindex, int data, enum type) ?

A:

The call is ambiguous because the compiler doesn't know which version of the function you want to call. For example, usage like this:
write(1, 2, 3);

What is the 3? It could be uint8_t or uint16_t or the others ... 
Instead of guessing, and potentially doing some crazy things, the compiler tells you it can't know. You can solve this in several ways:

Define distinct names for your functions eg. writeUInt8t(... , uint8_t in)
Specify exactly which to call in your use of the function: write(1, 2, static_cast<uint8_t>(3))

