3 Oct
2010
3 Oct
'10
9:21 a.m.
If a function returns a temporary, you probably don't want to hold onto it with a "const Foo& foo". The temporary will get deallocated and then you'll be left with a reference to dead memory, which is bad new bears: http://trac.webkit.org/changeset/68984 http://trac.webkit.org/changeset/68985 This kind of thing can be tricky to spot in code reviews because it's not obvious at the call site whether a function turns a temporary or a reference to some existing object. Adam