In C++ it's quite easy to get burned by keeping a reference to something where the owner went out of scope eg.
class Foo {
int bar;
int& getBar() { return bar; }
}
if you take ref of bar and Foo goes out of scope well fuck. It gets even worse, eg. : vector<int> foo;
int& bar = foo[i];
foo.push_back(1)
that last line can cause foo to reallocate the buffer and bar is then invalid, meanwhile that code will compile without warnings (well I'm guessing it will I haven't done C++ in a year :) )