help-gplusplus
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: non-local static object initialization problems


From: Timothy Baldwin
Subject: Re: non-local static object initialization problems
Date: Tue, 24 Jul 2007 11:38:55 +0100
User-agent: KNode/0.10.5

In message <1184244443.116681.209620@o61g2000hsh.googlegroups.com>, Ali
<ali.baharev@gmail.com> wrote:

> Hello,
> 
> Thank you for your valuable reply. I got the following link from an
> other group comp.lang.c++ (many thanks go to user "red floyd")
> 
> http://www.parashift.com/c++-faq-lite/ctors.html

A gcc specific solution is to use the init_priority attribute described in
section 6.7 of the gcc manual, for example:

          Some_Class  A  __attribute__ ((init_priority (2000)));
          Some_Class  B  __attribute__ ((init_priority (543)));

Objects with a lower priority number are initialised first. Of course this
is not standard C++.

-- 
OpenPGP key fingerprint: D0A6 F403 9745 CED4 6B3B  94CC 8D74 8FC9 9F7F CFE4



reply via email to

[Prev in Thread] Current Thread [Next in Thread]