
From: boost-bounces@lists.boost.org [mailto:boost-bounces@lists.boost.org] On Behalf Of JOAQUIN M. LOPEZ MUÑOZ Sent: Friday, July 11, 2008 11:35 AM
These precedence rules do not apply to class template static data: quoting the standard (latest draft at http://www.open- std.org/jtc1/sc22/wg21/docs/papers/2008/n2691.pdf), section 3.6.2:
Ah! This is just the sort of explanation I was looking for, but could not find--I guess my copy of the C++ standard has gone stale. Based on this, it certainly would appear that GCC's behavior is conformant and that the combination of fast_pool_allocator and singleton_default presumes behavior which is unspecified.
BTW, have you tried the fix I was proposing?
Not yet. I'm on vacation this week, but I will try it as soon as possible. My only concern is whether referencing singleton_default from the constructor for fast_pool_singleton will guarantee proper initialization ordering. 3.6.2 doesn't really shed any light on how ordered and unordered initialization may be coupled. There isn't, for example, any expressed guarantee that non-locals will be initialized prior to first reference. -Chris