title: C++ calls function of wrong signature
body: <p>I've got a header file with this api:</p>
  
  <pre><code>class XmlTree {
      public:
      template&lt;typename T&gt; void Set(const std::string&amp; path, const T&amp; val, const std::string&amp; attrib = "") {...}
      template&lt;typename T&gt; void Set(const std::string&amp; path, const T&amp; val, bool encrypt) {...}
  }
  </code></pre>
  
  <p>The code is executing this line:</p>
  
  <pre><code>static XmlTree get_root_response(const string&amp; api_name, int code = 0) {
      XmlTree output;
      //api_name is a const string&amp;="Wut", code is an int=200
      output.Set&lt;int&gt;("/" + api_name, code, "code"); //on this line
      ...
      return output;
  }
  </code></pre>
  
  <p>For some reason this calls the second Set function signature rather than the first. GDB shows this:</p>
  
  <pre><code>#1 XmlTree::Set&lt;int&gt; (this=address, path="/Wut", val=@address: 200, encrypt=true)
  #2 get_root_response(api_name="Wut", code=200)
  </code></pre>
  
  <p>So clearly the wrong function signature is being called, but I have no idea how on earth it got that bool input to pick the wrong one. Anyone have any idea why this might be happening?</p>