This is the mail archive of the gcc-help@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: Omit guard on static objects ?


hartmut.schirmer@arcor.de writes:

> Hi,
> 
> is there any way to omit the automatic construction guard
> created in
> 
> int foo()
> {
>   static class A a;
> ...
> }

If you define A so that its constructor and destructor are trivial,
    the gaurd will not be generated, unless there is an initializer
    for a.

Otherwise, the gaurd will always be present. 


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]