Talk About Network

Google


Register and Login
Nick
Password
Register create new account Sign up is FREE and you can post replies, new topics, bookmark posts and more!
Recover lost password


Programming > C++ Moderated > Order of destru...
Latest [ Topics | Posts ] Archive Post A New Topic Post a Reply
<< Topic < Post Post 1 of 39 Topic 9813 of 9909
Post > Topic >>

Order of destruct of local variables

by rkldabs@[EMAIL PROTECTED] Jul 21, 2008 at 04:31 AM

Hi,

Is the order of destruction of local variables of the function defined
in the C++ standard? For example in the following function, is it
always guaranteed that oAB is destroyed before oAC?

struct AB{
~AB(){}
};

struct AC{
~AC(){}
};

int main(){
AB oAB;
AC oAC;
}

I think the standard has reference only to the order of destruction of
static local variables, but not so much on the order for local
variables with auto storage.

Regards,
Dabs

-- 
      [ See http://www.gotw.ca/resources/clcm.htm
for info about ]
      [ comp.lang.c++.moderated.    First time posters: Do this! ]
 




 39 Posts in Topic:
Order of destruct of local variables
rkldabs@[EMAIL PROTECTED]  2008-07-21 04:31:10 
Re: Order of destruct of local variables
Greg Herlihy <greghe@[  2008-07-21 14:36:23 
Re: Order of destruct of local variables
Alberto Ganesh Barbati &l  2008-07-21 15:16:29 
Re: Order of destruct of local variables
LR <lruss@[EMAIL PROTE  2008-07-21 15:19:25 
Re: Order of destruct of local variables
Thomas Maeder <maeder@  2008-07-21 15:19:12 
Re: Order of destruct of local variables
Thomas Lehmann <t.lehm  2008-07-21 15:17:43 
Re: Order of destruct of local variables
ThosRTanner <ttanner2@  2008-07-21 15:20:25 
Re: Order of destruct of local variables
Alberto Ganesh Barbati &l  2008-07-21 23:15:15 
Re: Order of destruct of local variables
Thomas Lehmann <t.lehm  2008-07-22 15:31:22 
Re: Order of destruct of local variables
Le Chaud Lapin <jaibud  2008-07-22 15:58:15 
Re: Order of destruct of local variables
Dan Barbus <dan.barbus  2008-07-23 02:36:39 
Re: Order of destruct of local variables
JoshuaMaurice@[EMAIL PROT  2008-07-23 19:36:23 
Re: Order of destruct of local variables
Le Chaud Lapin <jaibud  2008-07-23 23:50:27 
Re: Order of destruct of local variables
Alberto Ganesh Barbati &l  2008-07-24 05:15:34 
Re: Order of destruct of local variables
JoshuaMaurice@[EMAIL PROT  2008-07-24 16:10:28 
Re: Order of destruct of local variables
Bart van Ingen Schenau &l  2008-07-24 16:08:12 
Re: Order of destruct of local variables
JoshuaMaurice@[EMAIL PROT  2008-07-24 17:22:17 
Re: Order of destruct of local variables
Le Chaud Lapin <jaibud  2008-07-24 19:58:15 
Re: Order of destruct of local variables
Eugene Gershnik <gersh  2008-07-25 02:46:32 
Re: Order of destruct of local variables
Nominal Pro <majorscio  2008-07-25 02:43:42 
Re: Order of destruct of local variables
Alberto Ganesh Barbati &l  2008-07-25 12:04:42 
Re: Order of destruct of local variables
Francis Glassborow <fr  2008-07-25 12:06:43 
Re: Order of destruct of local variables
Alberto Ganesh Barbati &l  2008-07-25 12:05:15 
Re: Order of destruct of local variables
Le Chaud Lapin <jaibud  2008-07-25 18:20:01 
Re: Order of destruct of local variables
Bart van Ingen Schenau &l  2008-07-25 18:19:47 
Re: Order of destruct of local variables
Alex <aleskx@[EMAIL PR  2008-07-25 18:25:28 
Re: Order of destruct of local variables
Eugene Gershnik <gersh  2008-07-26 13:27:15 
Re: Order of destruct of local variables
JoshuaMaurice@[EMAIL PROT  2008-07-27 03:18:50 
Re: Order of destruct of local variables
David Abrahams <dave@[  2008-07-27 03:28:18 
Re: Order of destruct of local variables
brangdon@[EMAIL PROTECTED  2008-07-27 15:35:17 
Re: Order of destruct of local variables
Nominal Pro <majorscio  2008-07-27 15:23:49 
Re: Order of destruct of local variables
bjarne <bjarne@[EMAIL   2008-07-27 15:37:41 
Re: Order of destruct of local variables
Alex <aleskx@[EMAIL PR  2008-07-27 15:36:50 
Re: Order of destruct of local variables
brangdon@[EMAIL PROTECTED  2008-07-28 12:37:25 
Re: Order of destruct of local variables
JoshuaMaurice@[EMAIL PROT  2008-07-28 17:58:18 
Re: Order of destruct of local variables
brangdon@[EMAIL PROTECTED  2008-07-29 15:28:19 
Re: Order of destruct of local variables
Mathias Gaunard <loufo  2008-07-27 15:41:11 
Re: Order of destruct of local variables
Nominal Pro <majorscio  2008-07-27 21:50:34 
Re: Order of destruct of local variables
Eugene Gershnik <gersh  2008-07-28 02:32:26 

Post A Reply:
  Go here to Signup

AddThis Feed Button


About - Advertising - Contact - Frequently Asked Questions - Privacy Policy - Terms of Use - Signup

Contact
tan12V112 Wed Aug 20 4:32:57 CDT 2008.