Why wouldn't the following line of code work in a method?
return (count > 0) ? true : false;
It works perfectly fine if I do:
bool ret = (count > 0) ? true : false;
return ret;
Bonus Question: Is it really faster or more effective than the standard if statement?
bool return = false;
if(count > 0)
{
ret = true;
}
return ret;
Which one would you recommend?