According to the C++ standard, in a native class, a static member
declaration is no definition:
class C {
public:
static int c1;
};
Without a definition like
int C::c1=17;
you get a linker error.
However, ref classes are different:
ref class R {
public:
static int c1;
};
seems to be sufficient, without an extra definition.
Why? I searched the C++/CLI standard and Google, but I found no
indication that ref classes and native classes have to behave different
with respect to static data members.
What did I miss?
Thanks
Richard
declaration is no definition:
class C {
public:
static int c1;
};
Without a definition like
int C::c1=17;
you get a linker error.
However, ref classes are different:
ref class R {
public:
static int c1;
};
seems to be sufficient, without an extra definition.
Why? I searched the C++/CLI standard and Google, but I found no
indication that ref classes and native classes have to behave different
with respect to static data members.
What did I miss?
Thanks
Richard