Boost logo

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.


"Ben Hutchings" <ben.hutchings_at_[hidden]> wrote in message
> 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, kalb at, bjorn.karlsson at, gregod at, wekempf at