I was trying to make a function where based on the parameter the function returns the value, like this:
type getValue(string input) return <OUTPUT>
OUTPUT's type would be changed to int, string, bool, etc., on what the input is given. I got that sorted but the problem that I've been having is the return type. I've tried auto type but all I got was this error:
error: inconsistent deduction for 'auto': 'int' and then 'char'
over and over again with every single types that this function can output. I wouldn't do templates because you have to do this
getValue<type>(input);
and I have no way to just guessing to output to put in the template type. I've used so many options that I can do but it was just way too complicated.