title: Changing return type of a function without template specialization. C++
body: <p>I was wondering if it is possible to change the return type of a function based on the type of variable it is being assigned to. Here's a quick example of what I mean.</p>
  
  <p>I want to create a function that parses a variable of int, bool, or float from a string. For example...</p>
  
  <pre><code>Int value = parse("37");
  Float value = parse("3.14");
  Bool value = parse("true");
  </code></pre>
  
  <p>I understand if I make this function a template, that the variable type must be determined from the argument list which is always going to be a string. Is there any other way of doing this with c++?</p>