If else branchs, and position of the return statement?
In a function whose entire logic falls along the lines of "if this condition is true/false, return this, else return this", what is the best or perhaps most accepted form for this to take?  There seem to be 3 ways I've seen.  

    int function(bool foo){
        if(foo){
             return doSomething();
        }else{
             return somethingElse;
        }
    }
This makes the most sense, but I've once read that a function with a return type should never have it's return type located in a branch.  (Why, the source never said)  So then there's this:

    int function(bool foo){
        if(foo){
             return doSomething();
        }
        return somethingElse;
    }
That has a return type outside of a branch, but it takes away some of the meaning of the code I think, and I've also read there's benefits to if-else blocks. (What those are, the source didn't say either) Finally, there's this:

    int function(bool foo){
        int result;
        if(foo){
             result = doSomething();
        }else{
             result = somethingElse;
        }
        return result;
    }
The meaning is there, return is outside of a branch, but at the addition of a variable and code that wasn't really needed for the functionality.

My question is which of these three forms, or any other form if there is one, would be the best way to write a function in this vein?
If else branchs, and position of the return statement?
===

In a function whose entire logic falls along the lines of "if this condition is true/false, return this, else return this", what is the best or perhaps most accepted form for this to take?  There seem to be 3 ways I've seen.  

    int function(bool foo){
        if(foo){
             return doSomething();
        }else{
             return somethingElse;
        }
    }
This makes the most sense, but I've once read that a function with a return type should never have it's return type located in a branch.  (Why, the source never said)  So then there's this:

    int function(bool foo){
        if(foo){
             return doSomething();
        }
        return somethingElse;
    }
That has a return type outside of a branch, but it takes away some of the meaning of the code I think, and I've also read there's benefits to if-else blocks. (What those are, the source didn't say either) Finally, there's this:

    int function(bool foo){
        int result;
        if(foo){
             result = doSomething();
        }else{
             result = somethingElse;
        }
        return result;
    }
The meaning is there, return is outside of a branch, but at the addition of a variable and code that wasn't really needed for the functionality.

My question is which of these three forms, or any other form if there is one, would be the best way to write a function in this vein?