POV-Ray : Newsgroups : povray.off-topic : C++ destructor question : C++ destructor question Server Time
3 Sep 2024 21:15:33 EDT (-0400)
  C++ destructor question  
From: Darren New
Date: 5 Aug 2010 15:27:25
Message: <4c5b109d@news.povray.org>
Speaking of RAII and all...

When an object is stuck into a standard collection in C++, and then the 
collection goes out of scope, what order is defined on the destructors of 
the things in the collection? I wouldn't imagine it's the order they were 
inserted (at least for a random-access type collection).  Does a stack 
destruct in a different order than a queue does, for example? Does a vector 
always destruct on increasing indexes?  (An array doesn't call the 
destructors of its element, does it?)

-- 
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.