Re: Инициализация статических членов класса
От: _DAle_ Беларусь  
Дата: 22.06.05 14:54
Оценка: 2 (1)
Здравствуйте, Anton0682, Вы писали:

A>Можно так инициализировать? Вроде очевидный синтаксис. А MSVC 6 не позволяет...


A>
A>class CSettings
A>{
A>    static CSettings * s_pSettings = NULL;
A>};
A>


The declaration of a static data member in its class definition is not a definition and may be of an incomplete type other than cv-qualified void. The definition for a static data member shall appear in a namespace scope enclosing the member’s class definition. In the definition at namespace scope, the name of the static data member shall be qualified by its class name using the :: operator.


class CSettings
{
    static CSettings * s_pSettings;
};

CSettings* CSettings::s_pSettings = NULL;
... << RSDN@Home 1.1.4 beta 7 rev. 447>>
 
Подождите ...
Wait...
Пока на собственное сообщение не было ответов, его можно удалить.