title: Can I make a function that returns a different type depending on a template argument, without using function parameters?
body: <p>This is almost what I want and it works:</p>
  <pre class="lang-cpp prettyprint-override"><code>int abc(int) {
      return 5;
  }
  
  float abc(float) {
      return 8.0;
  }
  
  
  int main() {
      std::cout &lt;&lt; abc(1) &lt;&lt; &quot;\n&quot;;
      std::cout &lt;&lt; abc(1.0f) &lt;&lt; &quot;\n&quot;;
  }
  </code></pre>
  <p>But I don't want to pass dummy parameters into the function. I want to have some sort of function and then use it like this:</p>
  <pre><code>int main() {
      std::cout &lt;&lt; abc&lt;int&gt;() &lt;&lt; &quot;\n&quot;;
      std::cout &lt;&lt; abc&lt;float&gt;() &lt;&lt; &quot;\n&quot;;
  }
  </code></pre>
  <p>Is that possible?</p>