B
Brice Gagnage
Hello,
I have a header containing static const variables declared at file
scope. This header is protected against multiple inclusion
(#ifndef/#define). These variables are of a class type (CComBSTR, for
those who know COM/ATL programming):
static const CComBSTR var( L"var" );
From what I understood about static initialization, the compiler is
supposed to allocate memory for each static variable declared like that,
which will be shared at file scope. This means, if I'm right, that the
ctor of CComBSTR will be called one time for each variable.
The problem is that when I put a breakpoint on this declaration, the
ctor of this var is called more than one time. Where am I mistaking ?
Thanks in advance,
I have a header containing static const variables declared at file
scope. This header is protected against multiple inclusion
(#ifndef/#define). These variables are of a class type (CComBSTR, for
those who know COM/ATL programming):
static const CComBSTR var( L"var" );
From what I understood about static initialization, the compiler is
supposed to allocate memory for each static variable declared like that,
which will be shared at file scope. This means, if I'm right, that the
ctor of CComBSTR will be called one time for each variable.
The problem is that when I put a breakpoint on this declaration, the
ctor of this var is called more than one time. Where am I mistaking ?
Thanks in advance,