Omit guard on static objects ?

llewelly@xmission.com llewelly@xmission.com
Tue Apr 27 14:16:00 GMT 2004


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. 



More information about the Gcc-help mailing list