POV-Ray : Newsgroups : povray.off-topic : C++ destructor question : Re: C++ destructor question Server Time
3 Sep 2024 21:12:22 EDT (-0400)
  Re: C++ destructor question  
From: Darren New
Date: 5 Aug 2010 16:31:06
Message: <4c5b1f8a$1@news.povray.org>
Warp wrote:
>   Funny, I have never thought of that. 

I can see where having a stack destruct as if it's popping things could be 
useful, for example. The topic came up discussing the Go "defer" bit in 
another thread.

> If I had to guess, I'd say that
> the standard leaves it up to the implementation.

OK. I'll look it up if it ever comes up.

>   Arrays (either stack-allocated or dynamically allocated with 'new') are,
> however, guaranteed to be constructed in the order of increasing indexes
> and destroyed in the reverse order.

Oh, so arrays do destruct. That's good to know. I guess that makes sense, 
tho, now that I think about it, since the values get constructed if they 
have constructors.

-- 
Darren New, San Diego CA, USA (PST)
    C# - a language whose greatest drawback
    is that its best implementation comes
    from a company that doesn't hate Microsoft.


Post a reply to this message

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