I know there is a very similar question already: Ternary operator ?: vs if...else
This is more regarding returning bool literals from a function.
Given the following function:
bool inRange(size_t value, size_t upperBound) const
{
return (value >= 0 && value < upperBound) ? true : false;
}
CLion advices me this can be simplified using an "if else" statement instead. Would this be actually faster because of return value optimization and/or likelihood of certain if branches? (or some other reason).
Or is it maybe a style guide given by CLion?