|
Boost Users : |
From: Matt S Trentini (matt_s_trentini_at_[hidden])
Date: 2003-11-11 20:11:11
Heya Ben,
You are, of course, totally correct. The only thing we can guarantee is
that 3 will be destroyed first.
Thanks!
Matt
"Ben Hutchings" <ben.hutchings_at_[hidden]> wrote in message
news:A7F746377BDB7D4EA8E6623AF92F43C80C7CCD_at_copper.bwsint.com...
> Matt S Trentini <matt_s_trentini_at_[hidden]> wrote:
> <snip>
> > You'll notice that I left the typedef in there. I can't find
> > anything in the standard (or with google) about it being illegal in
> > main, nor does my compiler emit any warnings. Can anyone shed some
> > light on this?
>
> There's nothing wrong with it. A typedef declaration is allowed
> wherever any other declaration is allowed, except in the condition of
> a 'for', 'if', 'switch' or 'while' statement.
>
> > And I've got to disagree with your friend about the correct ordering
> > - the expected output is 3, 1, 2 (Remember that foo_ptr gets deleted
> > first).
>
> I don't see any requirement on the order of destruction of sequence
> elements, so I think it can be either 3, 1, 2 or 3, 2, 1.
Boost-users list run by williamkempf at hotmail.com, kalb at libertysoft.com, bjorn.karlsson at readsoft.com, gregod at cs.rpi.edu, wekempf at cox.net