|
![](/i/fill.gif) |
Darren New wrote:
> I can pass you a void* and
That's a C feature. Real C++ programmers don't use void*. So no, of course
you have no RTTI on a void*.
> The traceback in your exceptions
> can tell you what the values passed as arguments to the function on each
> frame...
Yes they can.
> Hell, you can't even tell me how big an array is
No, but you'll see me using std::vector, not arrays, in C++.
> I know how it *won't* be implemented. It won't be implemented such that
> references to local variables survive the end of the stack frame those
> local variables are allocated in. That's enough.
They never do, and programmers better know that... They are "local
variables" for a reason. And in my mind it wouldn't be a stack if it kept
alive after 'popped' :D
int& foo() {
int myNumber = 42;
return myNumber;
}
Undefined behavior when the caller tries to do something with the reference.
Post a reply to this message
|
![](/i/fill.gif) |