title: "ambiguous call to overloaded function" when using variadic templates in VS2013
body: <p>Given the following code:</p>
  
  <pre><code>        template &lt;typename T&gt;
          bool TryQueryInterface(
              IUnknown* in_toQuery,
              REFIID riid,
              void **ppvObject,
              ComObject* in_parent,
              HRESULT out_result)
          {
              if (InterfaceProperties&lt;T&gt;::GetIID() == riid)
              {
                  void *underlying;
                  HRESULT result = in_toQuery-&gt;QueryInterface(riid, &amp;underlying);
                  if (SUCCEEDED(result))
                  {
                      *ppvObject = new typename InterfaceProperties&lt;T&gt;::WrapperClass(
                          *this,
                          (T*)underlying,
                          in_parent);
                  }
  
                  return true;
              }
  
              return false;
          }
  
          template &lt;typename T, typename... Interfaces&gt;
          bool TryQueryInterfaces(
              IUnknown* in_toQuery,
              REFIID riid,
              void **ppvObject,
              ComObject* in_parent,
              HRESULT out_result)
          {
              return TryQueryInterface&lt;T&gt;(in_toQuery, riid, ppvObject, in_parent, out_result) ||
                     TryQueryInterfaces&lt;Interfaces...&gt;(in_toQuery, riid, ppvObject, in_parent, out_result);
          }
  
          template &lt;typename T&gt;
          bool TryQueryInterfaces(
              IUnknown* in_toQuery,
              REFIID riid,
              void **ppvObject,
              ComObject* in_parent,
              HRESULT out_result)
          {
              return TryQueryInterface&lt;T&gt;(in_toQuery, riid, ppvObject, in_parent, out_result);
          }
  </code></pre>
  
  <p>I'm getting the following error:</p>
  
  <pre><code>    error C2668: 'TryQueryInterfaces' : ambiguous call to overloaded function
  TryQueryInterfaces&lt;ITrusteeGroupAdmin&gt;(IUnknown *,const IID &amp;,void **,ComObject *,HRESULT)'
   or       TryQueryInterfaces&lt;ITrusteeGroupAdmin,&gt;(IUnknown *,const IID &amp;,void **,ComObject *,HRESULT)'
            while trying to match the argument list '(IUnknown *, const IID, void **, ComObject *, HRESULT)'
  see reference to function template instantiation 'bool TryQueryInterfaces&lt;ITrusteeAdmin,ITrusteeGroupAdmin&gt;(IUnknown *,const IID &amp;,void **,ComObject *,HRESULT)' being compiled
  </code></pre>
  
  <p>What am I missing here? How do I construct an unambiguous base case for the recursion?</p>