|
Boost Users : |
From: Ben Hutchings (ben.hutchings_at_[hidden])
Date: 2003-11-11 08:35:27
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