|
From: Rob T. <ro...@ts...> - 2001-03-24 20:40:28
|
on 3/24/01 11:47 AM, Lark at lar...@ya... wrote: > Looks good! Actually, we probably could return a const string&, > mRename is supposed to be constant anyway (but can't really be > declared that way.) There are lifetime issues with that interface. The caller can't tell how long that string& will remain good. There's no reason not to return a copy of the string. The implementation of class string is efficient for copies; it doesn't actually copy the data of the string, just a reference to it. Rob |