title: template <class T>: error: 'T' does not name a type
body: <p>I'm trying to compile some code that compile fine in Arduino IDE, in Visual Studio with support for Arduino (Visual Micro). This is the code with problems:</p>
  
  <pre><code>template &lt;class T&gt; int EEPROM_writeAnything(int ee, const T&amp; value)
  {
      const byte* p = (const byte*)(const void*)&amp;value;
      unsigned int i;
      for (i = 0; i &lt; sizeof(value); i++)
            EEPROM.write(ee++, *p++);
      return i;
  }
  
  template &lt;class T&gt; int EEPROM_readAnything(int ee, T&amp; value)
  {
      byte* p = (byte*)(void*)&amp;value;
      unsigned int i;
      for (i = 0; i &lt; sizeof(value); i++)
            *p++ = EEPROM.read(ee++);
      return i;
  }
  </code></pre>
  
  <p>The error I'm getting is:</p>
  
  <pre><code>app.ino:43:40: error: 'T' does not name a type
  :int EEPROM_writeAnything(int ee, const T&amp; value)
  app.ino:43:43: error: ISO C++ forbids declaration of 'value' with no type [-fpermissive]
  </code></pre>
  
  <p>Can someone please point me in the right direction?</p>
  
  <p>Thanks.</p>