$include_dir="/home/hyper-archives/boost-users/include"; include("$include_dir/msg-header.inc") ?>
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. :-)