|
Boost Users : |
From: Peter Dimov (pdimov_at_[hidden])
Date: 2006-08-08 17:10:40
AlisdairM wrote:
> However, I freely admit I have no idea how to test if something uses
> static initialization or dynamic.
Todd Greer already posted one possible test, but a much simpler version is
extern array<int, 2> a;
int x = a[0];
array<int, 2> a = { 1, 2 };
int main()
{
assert( x == 1 );
}
As you state, it works only on compilers that get order of initialization
(and a few other portions of the C++ standard) correct. :-)
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