title: Compiler generating wrong call to template function?
body: <p>I have this struct:</p>
  
  <pre><code>template&lt;typename T&gt;
  struct static_type_array
  </code></pre>
  
  <p>Inside of it I have these functions:</p>
  
  <pre><code>inline T* Get(s32 Index)
  inline const T* Get(s32 Index) const 
  inline T* operator[](s32 Index)
  inline const T* operator[](s32 Index) const
  </code></pre>
  
  <p>I create these variables:</p>
  
  <pre><code>static_type_array&lt;vertex&gt; Vertices;
  static_type_array&lt;u32&gt; Indices;
  </code></pre>
  
  <p>The thing is, when I call to <code>Indices[Index]</code> I get to the function:</p>
  
  <pre><code>static_type_array&lt;u32&gt;::operator[]...
  </code></pre>
  
  <p>as expected.. but inside this function (<code>operator[]</code>) I call to <code>Get</code> with the index I get from the call, and this goes to:</p>
  
  <pre><code>static_type_array&lt;vertex&gt;::Get(s32 Index)...
  </code></pre>
  
  <p>which is really odd..
  I tried to figure out what was happening, and I saw something strage..</p>
  
  <p>This code:</p>
  
  <pre><code>inline T* operator[](s32 Index)
  {
      T* Result = Get(Index);
      return Result;
  }
  </code></pre>
  
  <p>will generate a call to the appropriate function (<code>&lt;u32&gt;</code>), while this code:</p>
  
  <pre><code>inline T* operator[](s32 Index)
  {
      return Get(Index);
  }
  </code></pre>
  
  <p>will generate a call to the wrong function (<code>&lt;vertex&gt;</code>)...</p>
  
  <p>I thought maybe its the inline but I tried removing it and its not that.</p>
  
  <p>Any idea what is going on with my code?</p>
  
  <p>EDIT: If I am missing any information let me know.</p>