title: Strange "Could not deduce template argument for 'T'" error
body: <p>The error is in <a href="http://pastebin.com/YzGMPzFz" rel="noreferrer">this</a> code:</p>
  
  <pre><code>//myutil.h
  template &lt;class T, class predicate&gt;
  T ConditionalInput(LPSTR inputMessage, LPSTR errorMessage, predicate condition);    
  
  //myutil.cpp
  template &lt;class T, class Pred&gt;
  T ConditionalInput(LPSTR inputMessage, LPSTR errorMessage, Pred condition)
  {
          T input
          cout&lt;&lt; inputMessage;
          cin&gt;&gt; input;
          while(!condition(input))
          {
                  cout&lt;&lt; errorMessage;
                  cin&gt;&gt; input;
          }
          return input;
  }
  
  ...
  
  //c_main.cpp 
  int row;
  
  row = ConditionalInput("Input the row of the number to lookup, row &gt; 0: ",
  "[INPUT ERROR]: Specified number is not contained in the range [row &gt; 0]. "
  "Please type again: ", [](int x){ return x &gt; 0; });
  </code></pre>
  
  <p>The error is:</p>
  
  <pre><code>Error   1       error C2783: 'T ConditionalInput(LPSTR,LPSTR,predicate)' :
  could not deduce template argument for 'T' c_main.cpp        17      1
  </code></pre>
  
  <p>I've been struggling with it for hours but can't seem to find a solution. I believe mistake might be trivial, but I couldn't find anyone else encountering the error under similar circumstances.
  Help much appreciated! </p>
  
  <p>EDIT: Correction made by Frederik Slijkerman fixes one issue but creates another. This time the error is:</p>
  
  <pre><code>Error   1   error LNK2019: unresolved external symbol "int __cdecl ConditionalInput&lt;int,class `anonymous namespace'::&lt;lambda0&gt; &gt;(char *,char *,class `anonymous namespace'::&lt;lambda0&gt;)" (??$ConditionalInput@HV&lt;lambda0&gt;@?A0x109237b6@@@@YAHPAD0V&lt;lambda0&gt;@?A0x109237b6@@@Z) referenced in function _main
  </code></pre>
  
  <p>Please bear with me and help me solve this issue.</p>