POV-Ray : Newsgroups : povray.off-topic : Standard libraries : Re: Standard libraries Server Time
6 Sep 2024 17:20:26 EDT (-0400)
  Re: Standard libraries  
From: Nicolas Alvarez
Date: 7 Mar 2009 17:33:54
Message: <49b2f651@news.povray.org>
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

Copyright 2003-2023 Persistence of Vision Raytracer Pty. Ltd.