I was wondering if it might be sort of advantageous for a c++ compiler if there's only one return statement in a function. one of my ex-bosses once told me so but I don't get the point if there would be any difference between declaring a return variable or simply having multiple return statements, e.g. in a switch-case statement.
So my question is: is there any difference, maybe in quality, performance or stack memory savings?
Don't write code to suit your compiler. That changes with every compiler and compiler version. What is true today might be wrong tomorrow. Write code so it readable and shows what you intent.
As for multiple returns I highly doubt that makes any difference at all. As for trying, compiling and profiling be very aware that optimization is highly suspect to context. Multiple returns might be twice as fast in your test case but half as fast in the next function, if it shows a difference at all. To get a reliable comparison you have to test many different functions and places they are used. But if you compile the two and get the same or nearly same assembler that is a good indication that the compiler really doesn't care.