I then again would have to add a static const string in every method returning a const string literal which would be kind of ugly I think. std::string is (at least in gcc) allocated on the heap with a few additional stack-variables like the length. Returning a const string is therefore not that bad and would invoke just a swallow copy (I could be wrong here). I am not sure about msv compilers though. I think we can even bet on the compiler doing return value optimization on rvalues in some cases.

http://cpp-next.com/archive/2009/08/want-speed-pass-by-value/