title: C++ Best Practice: function to accept uint8_t, uint16_t, uint32_t, float
body: <p>i've got a set of (potential overloading) functions:</p>
  
  <pre><code>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)
  </code></pre>
  
  <p>Despite eclipse showing me for example <code>typedef unsigned short int  uint16_t;</code> when I hover over the <code>uint16_t</code>, I've got the error:</p>
  
  <pre><code>call of overloaded ‘`write(int, int, int)`’ is ambiguous
  </code></pre>
  
  <p>Inside the function I must know, if data was a <code>uint8_t</code>, <code>uint16_t</code>, etc.</p>
  
  <p>What can i do?
  Is there another way, e.g. 
      <code>write(uint16_t index, uint16_t subindex, int data, enum type)</code> ?</p>