If you want to return the smaller of x and y I think you should pass the values to std::min and return the value. That way the code clearly shows what you are doing and you minimize the chance of making a mistake while writing those if statement.
return std::min(x, y);
Otherwise, in situations like this, you might want to use the conditional operator.